diff options
author | vignesh.babu@wipro.com <vignesh.babu@wipro.com> | 2007-04-16 02:05:33 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-05-06 10:33:11 -0400 |
commit | 4530a16967a52e7ff6f8840d7e323cfb589fa2ae (patch) | |
tree | b248226eca5563891eb2eacdbb3bfda958e1beed /drivers | |
parent | b7405e16435f710edfae6ba32bef4ca20d3de145 (diff) |
[SCSI] ch: kmalloc/memset->kzalloc
Replacing kmalloc/memset combination with kzalloc.
Signed-off-by: vignesh babu <vignesh.babu@wipro.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/ch.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index 2a2cc6cf1182..2311019304c0 100644 --- a/drivers/scsi/ch.c +++ b/drivers/scsi/ch.c | |||
@@ -319,10 +319,9 @@ ch_readconfig(scsi_changer *ch) | |||
319 | int result,id,lun,i; | 319 | int result,id,lun,i; |
320 | u_int elem; | 320 | u_int elem; |
321 | 321 | ||
322 | buffer = kmalloc(512, GFP_KERNEL | GFP_DMA); | 322 | buffer = kzalloc(512, GFP_KERNEL | GFP_DMA); |
323 | if (!buffer) | 323 | if (!buffer) |
324 | return -ENOMEM; | 324 | return -ENOMEM; |
325 | memset(buffer,0,512); | ||
326 | 325 | ||
327 | memset(cmd,0,sizeof(cmd)); | 326 | memset(cmd,0,sizeof(cmd)); |
328 | cmd[0] = MODE_SENSE; | 327 | cmd[0] = MODE_SENSE; |
@@ -530,10 +529,9 @@ ch_set_voltag(scsi_changer *ch, u_int elem, | |||
530 | u_char *buffer; | 529 | u_char *buffer; |
531 | int result; | 530 | int result; |
532 | 531 | ||
533 | buffer = kmalloc(512, GFP_KERNEL); | 532 | buffer = kzalloc(512, GFP_KERNEL); |
534 | if (!buffer) | 533 | if (!buffer) |
535 | return -ENOMEM; | 534 | return -ENOMEM; |
536 | memset(buffer,0,512); | ||
537 | 535 | ||
538 | dprintk("%s %s voltag: 0x%x => \"%s\"\n", | 536 | dprintk("%s %s voltag: 0x%x => \"%s\"\n", |
539 | clear ? "clear" : "set", | 537 | clear ? "clear" : "set", |
@@ -922,11 +920,10 @@ static int ch_probe(struct device *dev) | |||
922 | if (sd->type != TYPE_MEDIUM_CHANGER) | 920 | if (sd->type != TYPE_MEDIUM_CHANGER) |
923 | return -ENODEV; | 921 | return -ENODEV; |
924 | 922 | ||
925 | ch = kmalloc(sizeof(*ch), GFP_KERNEL); | 923 | ch = kzalloc(sizeof(*ch), GFP_KERNEL); |
926 | if (NULL == ch) | 924 | if (NULL == ch) |
927 | return -ENOMEM; | 925 | return -ENOMEM; |
928 | 926 | ||
929 | memset(ch,0,sizeof(*ch)); | ||
930 | ch->minor = ch_devcount; | 927 | ch->minor = ch_devcount; |
931 | sprintf(ch->name,"ch%d",ch->minor); | 928 | sprintf(ch->name,"ch%d",ch->minor); |
932 | mutex_init(&ch->lock); | 929 | mutex_init(&ch->lock); |