Skip to contentSkip to conversation

drivers: block: Remove unnecessary cast

PATCH In review Gustavo A. R. Silva 3 participants 3 messages Jan 11, 2017 – Jan 12, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: block: Remove unnecessary cast

This issue was detected using Coccinelle and the following semantic patch:

@@
expression * e;
expression arg1, arg2;
type T;
@@

- e = (T *)
+ e =
kmalloc(arg1, arg2);

---
 drivers/block/cciss_scsi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/block/cciss_scsi.c +1 -2
index a18de9d..98ba8fc 100644
@@ -647,8 +647,7 @@ cciss_scsi_setup(ctlr_info_t *h)
 	struct cciss_scsi_adapter_data_t * shba;
 
 	ccissscsi[h->ctlr].ndevices = 0;
-	shba = (struct cciss_scsi_adapter_data_t *)
-		kmalloc(sizeof(*shba), GFP_KERNEL);	
+	shba = kmalloc(sizeof(*shba), GFP_KERNEL);
 	if (shba == NULL)
 		return;
 	shba->scsi_host = NULL;
Signature · 1 line
2.5.0
#1 lore raw
Quoted 8 lines · Gustavo A. R. Silva

This issue was detected using Coccinelle and the following semantic patch:

@@
expression * e;
expression arg1, arg2;
type T;
@@

Quoted 8 lines

- e = (T *)
+ e =
kmalloc(arg1, arg2);

---
 drivers/block/cciss_scsi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Why send this to me?

#2 lore raw

Quoting Greg KH <[email protected]>:

Quoted 13 lines · Gustavo A. R. Silva
Quoted 12 lines

This issue was detected using Coccinelle and the following semantic patch:

@@
expression * e;
expression arg1, arg2;
type T;
@@

- e = (T *)
+ e =
kmalloc(arg1, arg2);

Quoted 6 lines
Quoted 4 lines
---
 drivers/block/cciss_scsi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Why send this to me?

Oops... Sorry... I was also working with the Staging tree, so it seems your e-mail address got in the middle at some point.

--
Gustavo A. R. Silva