All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gustavo A. R. Silva" <silvagustavosilva@gmail.com>
To: don.brace@microsemi.com, gregkh@linuxfoundation.org
Cc: esc.storagedev@microsemi.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] drivers: block: Remove unnecessary cast
Date: Wed, 11 Jan 2017 12:41:05 -0600	[thread overview]
Message-ID: <20170111184105.GA10766@embeddedgus> (raw)

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

             reply	other threads:[~2017-01-11 18:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-11 18:41 Gustavo A. R. Silva [this message]
2017-01-11 20:04 ` [PATCH] drivers: block: Remove unnecessary cast Greg KH
2017-01-11 23:44   ` Gustavo A. R. Silva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170111184105.GA10766@embeddedgus \
    --to=silvagustavosilva@gmail.com \
    --cc=don.brace@microsemi.com \
    --cc=esc.storagedev@microsemi.com \
    --cc=garsilva@embeddedor.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.