aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptscsih.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2006-01-13 12:27:50 -0500
committerJames Bottomley <jejb@mulgrave.(none)>2006-01-14 11:54:58 -0500
commit1ca00bb7916cb40b8140173c23481e11d92d6f6a (patch)
treee5a16f6f230556ce43f77139c729f09a16ec95fb /drivers/message/fusion/mptscsih.c
parenteeb846cefdd842af479393a7d0fd399a29e42532 (diff)
[SCSI] fusion: kzalloc / kcalloc conversion
Convert kmalloc + memset to kzalloc or kcalloc in fusion. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/message/fusion/mptscsih.c')
-rw-r--r--drivers/message/fusion/mptscsih.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index 93a16fa3c4ba..525d9aea2012 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -2162,10 +2162,9 @@ mptscsih_target_alloc(struct scsi_target *starget)
2162{ 2162{
2163 VirtTarget *vtarget; 2163 VirtTarget *vtarget;
2164 2164
2165 vtarget = kmalloc(sizeof(VirtTarget), GFP_KERNEL); 2165 vtarget = kzalloc(sizeof(VirtTarget), GFP_KERNEL);
2166 if (!vtarget) 2166 if (!vtarget)
2167 return -ENOMEM; 2167 return -ENOMEM;
2168 memset(vtarget, 0, sizeof(VirtTarget));
2169 starget->hostdata = vtarget; 2168 starget->hostdata = vtarget;
2170 return 0; 2169 return 0;
2171} 2170}
@@ -2185,14 +2184,13 @@ mptscsih_slave_alloc(struct scsi_device *sdev)
2185 VirtDevice *vdev; 2184 VirtDevice *vdev;
2186 struct scsi_target *starget; 2185 struct scsi_target *starget;
2187 2186
2188 vdev = kmalloc(sizeof(VirtDevice), GFP_KERNEL); 2187 vdev = kzalloc(sizeof(VirtDevice), GFP_KERNEL);
2189 if (!vdev) { 2188 if (!vdev) {
2190 printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n", 2189 printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n",
2191 hd->ioc->name, sizeof(VirtDevice)); 2190 hd->ioc->name, sizeof(VirtDevice));
2192 return -ENOMEM; 2191 return -ENOMEM;
2193 } 2192 }
2194 2193
2195 memset(vdev, 0, sizeof(VirtDevice));
2196 vdev->ioc_id = hd->ioc->id; 2194 vdev->ioc_id = hd->ioc->id;
2197 vdev->target_id = sdev->id; 2195 vdev->target_id = sdev->id;
2198 vdev->bus_id = sdev->channel; 2196 vdev->bus_id = sdev->channel;