Messages in this thread |  | | Date | Wed, 23 Aug 2000 19:15:40 +0100 (BST) | From | Tigran Aivazian <> | Subject | Re: [PATCH] sd.c: handling resource allocation failure |
| |
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 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.).
> 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.
regards, Tigran
- 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/
|  |