All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers: block: Remove unnecessary cast
@ 2017-01-11 18:41 Gustavo A. R. Silva
  2017-01-11 20:04 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2017-01-11 18:41 UTC (permalink / raw)
  To: don.brace, gregkh; +Cc: esc.storagedev, linux-scsi, linux-kernel

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

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

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

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/block/cciss_scsi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c
index a18de9d..98ba8fc 100644
--- a/drivers/block/cciss_scsi.c
+++ b/drivers/block/cciss_scsi.c
@@ -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;
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drivers: block: Remove unnecessary cast
  2017-01-11 18:41 [PATCH] drivers: block: Remove unnecessary cast Gustavo A. R. Silva
@ 2017-01-11 20:04 ` Greg KH
  2017-01-11 23:44   ` Gustavo A. R. Silva
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2017-01-11 20:04 UTC (permalink / raw)
  To: Gustavo A. R. Silva; +Cc: don.brace, esc.storagedev, linux-scsi, linux-kernel

On Wed, Jan 11, 2017 at 12:41:05PM -0600, Gustavo A. R. Silva wrote:
> This issue was detected using Coccinelle and the following semantic patch:
> 
> @@
> expression * e;
> expression arg1, arg2;
> type T;
> @@
> 
> - e = (T *)
> + e =
> kmalloc(arg1, arg2);
> 
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> ---
>  drivers/block/cciss_scsi.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Why send this to me?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drivers: block: Remove unnecessary cast
  2017-01-11 20:04 ` Greg KH
@ 2017-01-11 23:44   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2017-01-11 23:44 UTC (permalink / raw)
  To: Greg KH; +Cc: don.brace, esc.storagedev, linux-scsi, linux-kernel


Quoting Greg KH <gregkh@linuxfoundation.org>:

> On Wed, Jan 11, 2017 at 12:41:05PM -0600, Gustavo A. R. Silva wrote:
>> This issue was detected using Coccinelle and the following semantic patch:
>>
>> @@
>> expression * e;
>> expression arg1, arg2;
>> type T;
>> @@
>>
>> - e = (T *)
>> + e =
>> kmalloc(arg1, arg2);
>>
>> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
>> ---
>>  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







^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-12  0:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-11 18:41 [PATCH] drivers: block: Remove unnecessary cast Gustavo A. R. Silva
2017-01-11 20:04 ` Greg KH
2017-01-11 23:44   ` Gustavo A. R. Silva

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.