Skip to content

Commit

Permalink
ext4: add __user decoration to calls of copy_{from,to}_user()
Browse files Browse the repository at this point in the history
This quiets the sparse noise:

warning: incorrect type in argument 2 (different address spaces)
   expected void const [noderef] <asn:1>*from
   got struct fstrim_range *<noident>
warning: incorrect type in argument 1 (different address spaces)
   expected void [noderef] <asn:1>*to
   got struct fstrim_range *<noident>

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
  • Loading branch information
H Hartley Sweeten authored and Theodore Ts'o committed Oct 18, 2011
1 parent e0cbee3 commit e6705f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/ext4/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
return -EOPNOTSUPP;
}

if (copy_from_user(&range, (struct fstrim_range *)arg,
if (copy_from_user(&range, (struct fstrim_range __user *)arg,
sizeof(range)))
return -EFAULT;

Expand All @@ -360,7 +360,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
if (ret < 0)
return ret;

if (copy_to_user((struct fstrim_range *)arg, &range,
if (copy_to_user((struct fstrim_range __user *)arg, &range,
sizeof(range)))
return -EFAULT;

Expand Down

0 comments on commit e6705f7

Please sign in to comment.