Staging: rdma: amso1100: Remove unnecessary cast on void pointer
authorShraddha Barke <shraddha.6596@gmail.com>
Wed, 14 Oct 2015 19:28:27 +0000 (00:58 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Oct 2015 05:51:48 +0000 (22:51 -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/rdma/amso1100/c2.c
drivers/staging/rdma/amso1100/c2_ae.c
drivers/staging/rdma/amso1100/c2_intr.c

index 7f1e794a858cce632536bec4ce382b1325739ee8..35ac536b2d45de624407158ec4546dbf2c66c27f 100644 (file)
@@ -548,7 +548,7 @@ static irqreturn_t c2_interrupt(int irq, void *dev_id)
 {
        unsigned int netisr0, dmaisr;
        int handled = 0;
-       struct c2_dev *c2dev = (struct c2_dev *) dev_id;
+       struct c2_dev *c2dev = dev_id;
 
        /* Process CCILNET interrupts */
        netisr0 = readl(c2dev->regs + C2_NISR0);
index cedda25232be2454b3b2f0902152d96a7b1dfd75..eb7a92b2692facd4e055381ed8b3fb2da64577e1 100644 (file)
@@ -183,7 +183,7 @@ void c2_ae_event(struct c2_dev *c2dev, u32 mq_index)
        switch (resource_indicator) {
        case C2_RES_IND_QP:{
 
-               struct c2_qp *qp = (struct c2_qp *)resource_user_context;
+               struct c2_qp *qp = resource_user_context;
                struct iw_cm_id *cm_id = qp->cm_id;
                struct c2wr_ae_active_connect_results *res;
 
@@ -273,7 +273,7 @@ void c2_ae_event(struct c2_dev *c2dev, u32 mq_index)
                struct c2wr_ae_connection_request *req =
                        &wr->ae.ae_connection_request;
                struct iw_cm_id *cm_id =
-                       (struct iw_cm_id *)resource_user_context;
+                       resource_user_context;
 
                pr_debug("C2_RES_IND_EP event_id=%d\n", event_id);
                if (event_id != CCAE_CONNECTION_REQUEST) {
@@ -303,7 +303,7 @@ void c2_ae_event(struct c2_dev *c2dev, u32 mq_index)
 
        case C2_RES_IND_CQ:{
                struct c2_cq *cq =
-                   (struct c2_cq *) resource_user_context;
+                   resource_user_context;
 
                pr_debug("IB_EVENT_CQ_ERR\n");
                ib_event.device = &c2dev->ibdev;
index 3a17d9b36dbac2b947d7d09318878f00cc2e0403..74b32a9711244f7fddeebe9e498bf55fd0a6b110 100644 (file)
@@ -122,7 +122,7 @@ static void handle_vq(struct c2_dev *c2dev, u32 mq_index)
        struct iw_cm_event cm_event;
        int err;
 
-       reply_vq = (struct c2_mq *) c2dev->qptr_array[mq_index];
+       reply_vq = c2dev->qptr_array[mq_index];
 
        /*
         * get next msg from mq_index into adapter_msg.