diff mbox

[9/11] btrfs: silence sparse warnings in ioctl.c

Message ID 20100529094801.GJ5483@bicker (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter May 29, 2010, 9:48 a.m. UTC
None
diff mbox

Patch

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))