Staging: lustre: Drop unnecessary cast
authorShraddha Barke <shraddha.6596@gmail.com>
Mon, 27 Jul 2015 16:50:35 +0000 (22:20 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 Jul 2015 22:57:36 +0000 (15:57 -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-crypto.c

index aa3fffed1519fa85441435361fe95320db53190f..fbbc8a7e308dc40f5e5d714723a0849951509a07 100644 (file)
@@ -114,7 +114,7 @@ int cfs_crypto_hash_digest(unsigned char alg_id,
                crypto_free_hash(hdesc.tfm);
                return -ENOSPC;
        }
-       sg_init_one(&sl, (void *)buf, buf_len);
+       sg_init_one(&sl, buf, buf_len);
 
        hdesc.flags = 0;
        err = crypto_hash_digest(&hdesc, &sl, sl.length, hash);
@@ -165,7 +165,7 @@ int cfs_crypto_hash_update(struct cfs_crypto_hash_desc *hdesc,
 {
        struct scatterlist sl;
 
-       sg_init_one(&sl, (void *)buf, buf_len);
+       sg_init_one(&sl, buf, buf_len);
 
        return crypto_hash_update((struct hash_desc *)hdesc, &sl, sl.length);
 }
This page took 0.027967 seconds and 5 git commands to generate.