diff options
author | John L. Hammond <john.hammond@intel.com> | 2016-03-22 23:04:03 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-28 14:30:36 (GMT) |
commit | 5206726ad8e286a09e73ae4a542de47f96d62f27 (patch) | |
tree | 9abb589195206bee887f6cded3538466ecd7290a /drivers/staging/lustre/lnet/libcfs | |
parent | 7b54d08b01e61d35d57cb5cdbaf6cd02babcdf17 (diff) | |
download | linux-5206726ad8e286a09e73ae4a542de47f96d62f27.tar.xz |
staging: lustre: libcfs: remove libcfs_ioctl_popdata wrapper
Lets just use copy_to_user() directly instead of having a
wrapper function.
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/14180
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: frank zago <fzago@cray.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lnet/libcfs')
-rw-r--r-- | drivers/staging/lustre/lnet/libcfs/linux/linux-module.c | 7 | ||||
-rw-r--r-- | drivers/staging/lustre/lnet/libcfs/module.c | 7 |
2 files changed, 4 insertions, 10 deletions
diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c index ae05895..890a458 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c @@ -95,13 +95,6 @@ int libcfs_ioctl_getdata(struct libcfs_ioctl_hdr **hdr_pp, return err; } -int libcfs_ioctl_popdata(void __user *arg, void *data, int size) -{ - if (copy_to_user(arg, data, size)) - return -EFAULT; - return 0; -} - static int libcfs_psdev_open(struct inode *inode, struct file *file) { diff --git a/drivers/staging/lustre/lnet/libcfs/module.c b/drivers/staging/lustre/lnet/libcfs/module.c index 839145e8..74b9236 100644 --- a/drivers/staging/lustre/lnet/libcfs/module.c +++ b/drivers/staging/lustre/lnet/libcfs/module.c @@ -168,9 +168,10 @@ static int libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd, if (err == -EINVAL) continue; - if (!err) - err = libcfs_ioctl_popdata(uparam, hdr, - hdr->ioc_len); + if (!err) { + if (copy_to_user(uparam, hdr, hdr->ioc_len)) + err = -EFAULT; + } break; } up_read(&ioctl_list_sem); |