Staging: lustre: lnet: Remove useless cast on void pointer
authorShraddha Barke <shraddha.6596@gmail.com>
Fri, 4 Sep 2015 06:38:44 +0000 (12:08 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Sep 2015 01:24:48 +0000 (18:24 -0700)
void pointers do not need to be cast to other pointer types.

The semantic patch used to find this:

@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/lnet/klnds/socklnd/socklnd_cb.c

index d0c79d1bb9f6943dc2d3433bde46822dd0acee6a..6d87731c539dd62e86150c1e7ae6559a985e2b50 100644 (file)
@@ -1313,7 +1313,7 @@ ksocknal_recv (lnet_ni_t *ni, void *private, lnet_msg_t *msg, int delayed,
               unsigned int niov, struct kvec *iov, lnet_kiov_t *kiov,
               unsigned int offset, unsigned int mlen, unsigned int rlen)
 {
-       ksock_conn_t *conn = (ksock_conn_t *)private;
+       ksock_conn_t *conn = private;
        ksock_sched_t *sched = conn->ksnc_scheduler;
 
        LASSERT(mlen <= rlen);