Staging: lustre: lnet: Remove unnecessary cast on void pointer
authorShraddha Barke <shraddha.6596@gmail.com>
Wed, 14 Oct 2015 19:28:22 +0000 (00:58 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Oct 2015 05:26:35 +0000 (22:26 -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/o2iblnd/o2iblnd_cb.c

index f1799aa1fdad9b80d27b8251c3a8271903327e4c..8989e36091fba7f70b3ddd55c78a2ca49f01cc3d 100644 (file)
@@ -3234,7 +3234,7 @@ kiblnd_cq_completion(struct ib_cq *cq, void *arg)
         * consuming my CQ I could be called after all completions have
         * occurred.  But in this case, ibc_nrx == 0 && ibc_nsends_posted == 0
         * and this CQ is about to be destroyed so I NOOP. */
-       kib_conn_t *conn = (kib_conn_t *)arg;
+       kib_conn_t *conn = arg;
        struct kib_sched_info *sched = conn->ibc_sched;
        unsigned long flags;