From patchwork Tue Jul 15 19:17:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 4557801 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 067FBC0514 for ; Tue, 15 Jul 2014 19:17:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 473842017E for ; Tue, 15 Jul 2014 19:17:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 748FA2018B for ; Tue, 15 Jul 2014 19:17:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932926AbaGOTRG (ORCPT ); Tue, 15 Jul 2014 15:17:06 -0400 Received: from mailrelay008.isp.belgacom.be ([195.238.6.174]:39153 "EHLO mailrelay008.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932798AbaGOTRE (ORCPT ); Tue, 15 Jul 2014 15:17:04 -0400 X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AokRAAB+xVNbsm9N/2dsb2JhbABZgw6BKaw8CwUBbpwAgRAXdYRgI4EaDSqIRgHKQ4V7iGxkHYQtBZsYlCWDRjsvgQM Received: from 77.111-178-91.adsl-dyn.isp.belgacom.be (HELO linux-zvq9.site) ([91.178.111.77]) by relay.skynet.be with ESMTP; 15 Jul 2014 21:16:47 +0200 From: Fabian Frederick To: linux-kernel@vger.kernel.org Cc: Fabian Frederick , Chris Mason , Josef Bacik , linux-btrfs@vger.kernel.org Subject: [PATCH 1/1] Btrfs: fix sparse warning Date: Tue, 15 Jul 2014 21:17:17 +0200 Message-Id: <1405451837-8235-1-git-send-email-fabf@skynet.be> X-Mailer: git-send-email 1.8.4.5 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix the following sparse warning: fs/btrfs/send.c:518:51: warning: incorrect type in argument 2 (different address spaces) fs/btrfs/send.c:518:51: expected char const [noderef] * fs/btrfs/send.c:518:51: got char * We can safely use (const char __user *) with set_fs(KERNEL_DS) __force added to avoid sparse-all warning: fs/btrfs/send.c:518:40: warning: cast adds address space to expression () Signed-off-by: Fabian Frederick Reviewed-by: Zach Brown --- This is untested. fs/btrfs/send.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 6528aa6..b67e12e 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -515,7 +515,8 @@ static int write_buf(struct file *filp, const void *buf, u32 len, loff_t *off) set_fs(KERNEL_DS); while (pos < len) { - ret = vfs_write(filp, (char *)buf + pos, len - pos, off); + ret = vfs_write(filp, (__force const char __user *)buf + pos, + len - pos, off); /* TODO handle that correctly */ /*if (ret == -ERESTARTSYS) { continue;