]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
IB/rxe: Remove unneeded cast in rxe_srq_from_attr()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 17 Nov 2016 11:00:05 +0000 (14:00 +0300)
committerDoug Ledford <dledford@redhat.com>
Mon, 12 Dec 2016 21:31:45 +0000 (16:31 -0500)
It makes me nervous when we cast pointer parameters.  I would estimate
that around 50% of the time, it indicates a bug.  Here the cast is not
needed becaue u32 and and unsigned int are the same thing.  Removing the
cast makes the code more robust and future proof in case any of the
types change.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Acked-by: Moni Shoua <monis@mellanox.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/sw/rxe/rxe_srq.c

index 2a6e3cd2d4e8f12c57ec66c623fc99061c1536b9..efc832a2d7c6b924a36280b8ecf242b3c3352f49 100644 (file)
@@ -169,7 +169,7 @@ int rxe_srq_from_attr(struct rxe_dev *rxe, struct rxe_srq *srq,
                        }
                }
 
-               err = rxe_queue_resize(q, (unsigned int *)&attr->max_wr,
+               err = rxe_queue_resize(q, &attr->max_wr,
                                       rcv_wqe_size(srq->rq.max_sge),
                                       srq->rq.queue->ip ?
                                                srq->rq.queue->ip->context :