staging: lustre: libcfs: remove libcfs_ioctl_popdata wrapper
authorJohn L. Hammond <john.hammond@intel.com>
Tue, 22 Mar 2016 23:04:03 +0000 (19:04 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Mar 2016 14:30:36 +0000 (07:30 -0700)
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>
drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
drivers/staging/lustre/lnet/libcfs/linux/linux-module.c
drivers/staging/lustre/lnet/libcfs/module.c

index d167d2eaa84d8312e7eb755f14e724e4fec03de8..45d1165a6ed4e8a8b3f54969bb3a4ea8ccd5fff9 100644 (file)
@@ -214,7 +214,6 @@ static inline bool libcfs_ioctl_is_invalid(struct libcfs_ioctl_data *data)
 
 int libcfs_ioctl_getdata(struct libcfs_ioctl_hdr **hdr_pp,
                         const struct libcfs_ioctl_hdr __user *uparam);
-int libcfs_ioctl_popdata(void __user *arg, void *buf, int size);
 int libcfs_ioctl_data_adjust(struct libcfs_ioctl_data *data);
 
 #endif /* __LIBCFS_IOCTL_H__ */
index ae058956f2095f5d7ae06ec65dc77c93bed4542d..890a4588049d47e16d5c67c711523956e301c7b1 100644 (file)
@@ -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)
 {
index 839145e80d9825690deb87b54cbb9379aedcefd7..74b92369ac0209cec70aa76222e4a9876a3bf3af 100644 (file)
@@ -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);