public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: "Tobin C. Harding" <me@tobin.cc>
To: Don Brace <don.brace@microsemi.com>
Cc: linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org,
	"Tobin C. Harding" <me@tobin.cc>
Subject: [PATCH 3/3] cciss: Remove kmalloc cast
Date: Wed, 22 Feb 2017 05:49:11 +0000	[thread overview]
Message-ID: <1487742551-10839-4-git-send-email-me@tobin.cc> (raw)
In-Reply-To: <1487742551-10839-1-git-send-email-me@tobin.cc>

Coccinelle emits a warning about casting the return value of
kmalloc(). Coccinelle suggests removing the cast as do
kerneljanitors.

Remove cast from kmalloc() call.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
---
 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 f5c21f3..01a1f7e 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.7.4


  parent reply	other threads:[~2017-02-22  5:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-22  5:49 [PATCH 0/3] cciss: Fix coccinelle/checkpatch warnings Tobin C. Harding
2017-02-22  5:49 ` [PATCH 1/3] cciss: Fix checkpatch TRAILING_WHITESPACE Tobin C. Harding
2017-02-22  5:49 ` [PATCH 2/3] cciss: Fix checkpatch OPEN_BRACE Tobin C. Harding
2017-02-22  5:49 ` Tobin C. Harding [this message]
2017-02-22  6:12 ` [PATCH 0/3] cciss: Fix coccinelle/checkpatch warnings Tobin C. Harding
2017-02-22  6:12   ` [PATCH 1/3] cciss: Fix checkpatch TRAILING_WHITESPACE Tobin C. Harding
2017-02-22 15:20     ` Don Brace
2017-02-22  6:12   ` [PATCH 2/3] cciss: Fix checkpatch OPEN_BRACE Tobin C. Harding
2017-02-22 15:17     ` Don Brace
2017-02-22  6:12   ` [PATCH 3/3] cciss: Remove kmalloc cast Tobin C. Harding
2017-02-22 15:16     ` Don Brace
2017-02-22 15:34   ` [PATCH 0/3] cciss: Fix coccinelle/checkpatch warnings Jens Axboe

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=1487742551-10839-4-git-send-email-me@tobin.cc \
    --to=me@tobin.cc \
    --cc=don.brace@microsemi.com \
    --cc=kernel-janitors@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox