Staging: lustre: libcfs: Drop unnecessary cast on void*
authorShraddha Barke <shraddha.6596@gmail.com>
Tue, 4 Aug 2015 17:32:33 +0000 (23:02 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Aug 2015 19:18:00 +0000 (12:18 -0700)
This patch does away with the cast on void * as it is unnecessary.

Semantic patch used is as follows:

@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/libcfs/linux/linux-module.c

index e962f89683a60cdb68ee67b3070bc185d783027e..78acff0682170c2c212fa412580baf3b382279ad 100644 (file)
@@ -49,7 +49,7 @@ int libcfs_ioctl_getdata(char *buf, char *end, void *arg)
        hdr = (struct libcfs_ioctl_hdr *)buf;
        data = (struct libcfs_ioctl_data *)buf;
 
-       if (copy_from_user(buf, (void *)arg, sizeof(*hdr)))
+       if (copy_from_user(buf, arg, sizeof(*hdr)))
                return -EFAULT;
 
        if (hdr->ioc_version != LIBCFS_IOCTL_VERSION) {
@@ -69,7 +69,7 @@ int libcfs_ioctl_getdata(char *buf, char *end, void *arg)
        }
 
        orig_len = hdr->ioc_len;
-       if (copy_from_user(buf, (void *)arg, hdr->ioc_len))
+       if (copy_from_user(buf, arg, hdr->ioc_len))
                return -EFAULT;
        if (orig_len != data->ioc_len)
                return -EINVAL;
This page took 0.025509 seconds and 5 git commands to generate.