Skip to contentSkip to conversation

staging: rdma: hfi1: user_sdma.c: Drop void pointer cast

PATCH New Janani Ravichandran 1 participant 1 message Feb 25, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rdma: hfi1: user_sdma.c: Drop void pointer cast

Void pointers need not be cast to other pointer types. Semantic patch used:

@r@
expression x;
void *e;
type T;
identifier f;
@@

(
*((T *)e)
|
((T *)x) [...]
|
((T *)x)->f
|
- (T *)
e
)

---
 drivers/staging/rdma/hfi1/user_sdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rdma/hfi1/user_sdma.c +1 -1
index 2f48419..d152126a 100644
@@ -345,7 +345,7 @@ static void activate_packet_queue(struct iowait *wait, int reason)
 
 static void sdma_kmem_cache_ctor(void *obj)
 {
-	struct user_sdma_txreq *tx = (struct user_sdma_txreq *)obj;
+	struct user_sdma_txreq *tx = obj;
 
 	memset(tx, 0, sizeof(*tx));
 }
Signature · 1 line
2.5.0