[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1011090027150.4512@swampdragon.chaosbits.net>
Date: Tue, 9 Nov 2010 00:30:21 +0100 (CET)
From: Jesper Juhl <jj@...osbits.net>
To: Joe Perches <joe@...ches.com>
cc: linux-kernel@...r.kernel.org, trivial@...nel.org,
linux-scsi@...r.kernel.org, osst-users@...ts.sourceforge.net,
"James E.J. Bottomley" <James.Bottomley@...e.de>,
Hannes Reinecke <hare@...e.de>
Subject: Re: [PATCH 08/17][trivial] scsi: Remove unnecessary casts of void
ptr returning alloc function return values
On Mon, 8 Nov 2010, Joe Perches wrote:
> On Tue, 2010-11-09 at 00:09 +0100, Jesper Juhl wrote:
> > Signed-off-by: Jesper Juhl <jj@...osbits.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.
>
True, I did notice that, and I guess I could have done that as part of
this patch series, just as there are lots of other minor improvements I
was tempted to do. But, I wanted to keep the entire patch series to a
single specific topic, then once they are merged (hopefully) I can follow
up with other cleanups.
--
Jesper Juhl <jj@...osbits.net> http://www.chaosbits.net/
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists