lkml.org 
[lkml]   [2000]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sd.c: handling resource allocation failure
Em Wed, Aug 23, 2000 at 07:15:40PM +0100, Tigran Aivazian escreveu:
> On Wed, 23 Aug 2000, Arnaldo Carvalho de Melo wrote:
> > -static struct gendisk *sd_gendisks = &sd_gendisk;
> > +static struct gendisk *sd_gendisks = NULL;
>
> no need to set things to NULL, BSS is zero-cleared by the kernel on

good, fixing.

> boot. See the code in arch/i386/kernel/head.S (look for surprises)
>
> > rscsi_disks = (Scsi_Disk *)
> > kmalloc(sd_template.dev_max * sizeof(Scsi_Disk), GFP_ATOMIC);
>
> no need to cast return from kmalloc, it returns (void *) and typecasts are
> tiresome to eyes (human eyes, i.e.).

I was trying to keep my patch as small as possible, changing just the needed
parts, yes, I agree, no need for casts

> > sd_hardsizes = (int *) kmalloc((sd_template.dev_max << 4) * sizeof(int), GFP_ATOMIC);
>
> same here and elsewhere, I know, it's not yours but while you are there,
> please clean up.

yap, I'll do it now. thanks for your quick feedback!

- Arnaldo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:37    [W:0.057 / U:0.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site