From: Joe Perches <joe@perches.com>
To: Jesper Juhl <jj@chaosbits.net>
Cc: linux-kernel@vger.kernel.org, trivial@kernel.org,
linux-scsi@vger.kernel.org, osst-users@lists.sourceforge.net,
"James E.J. Bottomley" <James.Bottomley@suse.de>,
Hannes Reinecke <hare@suse.de>
Subject: Re: [PATCH 08/17][trivial] scsi: Remove unnecessary casts of void ptr returning alloc function return values
Date: Mon, 08 Nov 2010 15:34:26 -0800 [thread overview]
Message-ID: <1289259266.29216.486.camel@Joe-Laptop> (raw)
In-Reply-To: <alpine.LNX.2.00.1011082334400.23697@swampdragon.chaosbits.net>
On Tue, 2010-11-09 at 00:09 +0100, Jesper Juhl wrote:
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>
> diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c
[]
> @@ -4780,7 +4780,7 @@ ahc_init_scbdata(struct ahc_softc *ahc)
> SLIST_INIT(&scb_data->sg_maps);
>
> /* Allocate SCB resources */
> - scb_data->scbarray = (struct scb *)kmalloc(sizeof(struct scb) * AHC_SCB_MAX_ALLOC, GFP_ATOMIC);
> + scb_data->scbarray = kmalloc(sizeof(struct scb) * AHC_SCB_MAX_ALLOC, GFP_ATOMIC);
> if (scb_data->scbarray == NULL)
> return (ENOMEM);
> memset(scb_data->scbarray, 0, sizeof(struct scb) * AHC_SCB_MAX_ALLOC);
This would be better as:
scb_data->scbarray = kcalloc(AHC_SCB_MAX_ALLOC, sizeof(struct scb), GFP_ATOMIC)
without the memset.
next prev parent reply other threads:[~2010-11-08 23:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-08 23:09 [PATCH 08/17][trivial] scsi: Remove unnecessary casts of void ptr returning alloc function return values Jesper Juhl
2010-11-08 23:34 ` Joe Perches [this message]
2010-11-08 23:30 ` Jesper Juhl
2011-01-19 14:27 ` Jiri Kosina
2011-01-20 7:29 ` Hannes Reinecke
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=1289259266.29216.486.camel@Joe-Laptop \
--to=joe@perches.com \
--cc=James.Bottomley@suse.de \
--cc=hare@suse.de \
--cc=jj@chaosbits.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=osst-users@lists.sourceforge.net \
--cc=trivial@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