From patchwork Sat May 29 09:48:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 103029 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4T9mNLd027188 for ; Sat, 29 May 2010 09:48:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756038Ab0E2JsV (ORCPT ); Sat, 29 May 2010 05:48:21 -0400 Received: from mail-ew0-f216.google.com ([209.85.219.216]:32893 "EHLO mail-ew0-f216.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755796Ab0E2JsU (ORCPT ); Sat, 29 May 2010 05:48:20 -0400 Received: by ewy8 with SMTP id 8so555407ewy.28 for ; Sat, 29 May 2010 02:48:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=YcDv+pHxtt3zZLTKUZEuQj9CdOIRVYMx8GvVJCgiLCg=; b=bJg5UAn8xeYAfuwC64FySi14MXOqfufd3t+KY7p2B7Ax045Ug8cUJP5YbMnA14o1OY sbkXXBAZgXt2LitWFAhqJ50ITW2rLc0R7X1PaN97D1+BSK1Y6jAMfSuP6TC9bpPpMeyP IAY2aAEWG9fCNFHqTDzKmf/Ks47JapUVguyXk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=pEIsAVH1WAls5cmvAsgAGdw5NDBpMDBMslGfQvta3DL600cfO0QGJcH9IOon12NJdf 30uNiTzZAXXe+3x6G0X2j6iMiQJXXzPS9CJ8Q4gSlY9u+7EiJHNoejQGq/tjr24w+X1B 8kyG8KMy6fjg7WsjfYO4GtwZeEahaSpcOmJ9I= Received: by 10.213.35.72 with SMTP id o8mr813241ebd.51.1275126498514; Sat, 29 May 2010 02:48:18 -0700 (PDT) Received: from bicker ([205.177.176.130]) by mx.google.com with ESMTPS id 14sm1724473ewy.6.2010.05.29.02.48.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 29 May 2010 02:48:18 -0700 (PDT) Date: Sat, 29 May 2010 11:48:01 +0200 From: Dan Carpenter To: linux-btrfs@vger.kernel.org Cc: Yan Zheng , Josef Bacik , Sage Weil , Chris Mason , kernel-janitors@vger.kernel.org Subject: [patch 9/11] btrfs: silence sparse warnings in ioctl.c Message-ID: <20100529094801.GJ5483@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 29 May 2010 09:48:24 +0000 (UTC) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 4dbaf89..a945a66 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -1869,21 +1869,19 @@ static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp) return 0; } -long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg) +static long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg) { struct btrfs_ioctl_space_args space_args; struct btrfs_ioctl_space_info space; struct btrfs_ioctl_space_info *dest; struct btrfs_ioctl_space_info *dest_orig; - struct btrfs_ioctl_space_info *user_dest; + struct btrfs_ioctl_space_info __user *user_dest; struct btrfs_space_info *info; int alloc_size; int ret = 0; int slot_count = 0; - if (copy_from_user(&space_args, - (struct btrfs_ioctl_space_args __user *)arg, - sizeof(space_args))) + if (copy_from_user(&space_args, arg, sizeof(space_args))) return -EFAULT; /* first we count slots */ @@ -1933,7 +1931,7 @@ long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg) } rcu_read_unlock(); - user_dest = (struct btrfs_ioctl_space_info *) + user_dest = (struct btrfs_ioctl_space_info __user *) (arg + sizeof(struct btrfs_ioctl_space_args)); if (copy_to_user(user_dest, dest_orig, alloc_size))