]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
drivers/scsi/ide-scsi.c: kmalloc + memset conversion to kzalloc
authorMariusz Kozlowski <m.kozlowski@tuxland.pl>
Wed, 1 Aug 2007 21:46:45 +0000 (23:46 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Wed, 1 Aug 2007 21:46:45 +0000 (23:46 +0200)
 drivers/scsi/ide-scsi.c | 34642 -> 34536 (-106 bytes)
 drivers/scsi/ide-scsi.o | 171728 -> 171524 (-204 bytes)

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/scsi/ide-scsi.c

index bb90df8bdce4ef7c204f8e93bc664e85649eedfc..1cc01acc28089060b6aa39f677e630b06c3a83f9 100644 (file)
@@ -328,17 +328,15 @@ static int idescsi_check_condition(ide_drive_t *drive, struct request *failed_co
        u8             *buf;
 
        /* stuff a sense request in front of our current request */
-       pc = kmalloc (sizeof (idescsi_pc_t), GFP_ATOMIC);
-       rq = kmalloc (sizeof (struct request), GFP_ATOMIC);
-       buf = kmalloc(SCSI_SENSE_BUFFERSIZE, GFP_ATOMIC);
-       if (pc == NULL || rq == NULL || buf == NULL) {
+       pc = kzalloc(sizeof(idescsi_pc_t), GFP_ATOMIC);
+       rq = kmalloc(sizeof(struct request), GFP_ATOMIC);
+       buf = kzalloc(SCSI_SENSE_BUFFERSIZE, GFP_ATOMIC);
+       if (!pc || !rq || !buf) {
                kfree(buf);
                kfree(rq);
                kfree(pc);
                return -ENOMEM;
        }
-       memset (pc, 0, sizeof (idescsi_pc_t));
-       memset (buf, 0, SCSI_SENSE_BUFFERSIZE);
        ide_init_drive_cmd(rq);
        rq->special = (char *) pc;
        pc->rq = rq;