* [patch 9/11] btrfs: silence sparse warnings in ioctl.c
@ 2010-05-29 9:48 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2010-05-29 9:48 UTC (permalink / raw)
To: linux-btrfs
Cc: Yan Zheng, Josef Bacik, Sage Weil, Chris Mason, kernel-janitors
I fixed the following sparse warnings:
fs/btrfs/ioctl.c:1936:22: warning: cast removes address space of expression
fs/btrfs/ioctl.c:1939:26: warning: incorrect type in argument 1 (different address spaces)
fs/btrfs/ioctl.c:1939:26: expected void [noderef] <asn:1>*to
fs/btrfs/ioctl.c:1939:26: got struct btrfs_ioctl_space_info *[assigned] user_dest
fs/btrfs/ioctl.c:1872:6: warning: symbol 'btrfs_ioctl_space_info' was not declared. Should it be static?
Also I noticed that a related cast of "arg" could be removed so I did
that.
Signed-off-by: Dan Carpenter <error27@gmail.com>
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))
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-05-29 9:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-29 9:48 [patch 9/11] btrfs: silence sparse warnings in ioctl.c Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).