Commit 4530a169 authored by vignesh.babu@wipro.com's avatar vignesh.babu@wipro.com Committed by James Bottomley

[SCSI] ch: kmalloc/memset->kzalloc

Replacing kmalloc/memset combination with kzalloc.
Signed-off-by: default avatarvignesh babu <vignesh.babu@wipro.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent b7405e16
...@@ -319,10 +319,9 @@ ch_readconfig(scsi_changer *ch) ...@@ -319,10 +319,9 @@ ch_readconfig(scsi_changer *ch)
int result,id,lun,i; int result,id,lun,i;
u_int elem; u_int elem;
buffer = kmalloc(512, GFP_KERNEL | GFP_DMA); buffer = kzalloc(512, GFP_KERNEL | GFP_DMA);
if (!buffer) if (!buffer)
return -ENOMEM; return -ENOMEM;
memset(buffer,0,512);
memset(cmd,0,sizeof(cmd)); memset(cmd,0,sizeof(cmd));
cmd[0] = MODE_SENSE; cmd[0] = MODE_SENSE;
...@@ -530,10 +529,9 @@ ch_set_voltag(scsi_changer *ch, u_int elem, ...@@ -530,10 +529,9 @@ ch_set_voltag(scsi_changer *ch, u_int elem,
u_char *buffer; u_char *buffer;
int result; int result;
buffer = kmalloc(512, GFP_KERNEL); buffer = kzalloc(512, GFP_KERNEL);
if (!buffer) if (!buffer)
return -ENOMEM; return -ENOMEM;
memset(buffer,0,512);
dprintk("%s %s voltag: 0x%x => \"%s\"\n", dprintk("%s %s voltag: 0x%x => \"%s\"\n",
clear ? "clear" : "set", clear ? "clear" : "set",
...@@ -922,11 +920,10 @@ static int ch_probe(struct device *dev) ...@@ -922,11 +920,10 @@ static int ch_probe(struct device *dev)
if (sd->type != TYPE_MEDIUM_CHANGER) if (sd->type != TYPE_MEDIUM_CHANGER)
return -ENODEV; return -ENODEV;
ch = kmalloc(sizeof(*ch), GFP_KERNEL); ch = kzalloc(sizeof(*ch), GFP_KERNEL);
if (NULL == ch) if (NULL == ch)
return -ENOMEM; return -ENOMEM;
memset(ch,0,sizeof(*ch));
ch->minor = ch_devcount; ch->minor = ch_devcount;
sprintf(ch->name,"ch%d",ch->minor); sprintf(ch->name,"ch%d",ch->minor);
mutex_init(&ch->lock); mutex_init(&ch->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment