diff options
author | Jes Sorensen <jes@sgi.com> | 2006-01-16 10:31:18 -0500 |
---|---|---|
committer | <jejb@mulgrave.il.steeleye.com> | 2006-02-27 23:55:02 -0500 |
commit | 24669f75a3231fa37444977c92d1f4838bec1233 (patch) | |
tree | 3b64076b7d031aa31b95caeb512fb7e68b5fd28f /drivers/scsi/scsi_scan.c | |
parent | b9a33cebac70d6f67a769ce8d4078fee2b254ada (diff) |
[SCSI] SCSI core kmalloc2kzalloc
Change the core SCSI code to use kzalloc rather than kmalloc+memset
where possible.
Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_scan.c')
-rw-r--r-- | drivers/scsi/scsi_scan.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 5acb83ca5ae5..74863da1d630 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c | |||
@@ -205,12 +205,11 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, | |||
205 | int display_failure_msg = 1, ret; | 205 | int display_failure_msg = 1, ret; |
206 | struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); | 206 | struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); |
207 | 207 | ||
208 | sdev = kmalloc(sizeof(*sdev) + shost->transportt->device_size, | 208 | sdev = kzalloc(sizeof(*sdev) + shost->transportt->device_size, |
209 | GFP_ATOMIC); | 209 | GFP_ATOMIC); |
210 | if (!sdev) | 210 | if (!sdev) |
211 | goto out; | 211 | goto out; |
212 | 212 | ||
213 | memset(sdev, 0, sizeof(*sdev)); | ||
214 | sdev->vendor = scsi_null_device_strs; | 213 | sdev->vendor = scsi_null_device_strs; |
215 | sdev->model = scsi_null_device_strs; | 214 | sdev->model = scsi_null_device_strs; |
216 | sdev->rev = scsi_null_device_strs; | 215 | sdev->rev = scsi_null_device_strs; |
@@ -334,12 +333,11 @@ static struct scsi_target *scsi_alloc_target(struct device *parent, | |||
334 | struct scsi_target *starget; | 333 | struct scsi_target *starget; |
335 | struct scsi_target *found_target; | 334 | struct scsi_target *found_target; |
336 | 335 | ||
337 | starget = kmalloc(size, GFP_KERNEL); | 336 | starget = kzalloc(size, GFP_KERNEL); |
338 | if (!starget) { | 337 | if (!starget) { |
339 | printk(KERN_ERR "%s: allocation failure\n", __FUNCTION__); | 338 | printk(KERN_ERR "%s: allocation failure\n", __FUNCTION__); |
340 | return NULL; | 339 | return NULL; |
341 | } | 340 | } |
342 | memset(starget, 0, size); | ||
343 | dev = &starget->dev; | 341 | dev = &starget->dev; |
344 | device_initialize(dev); | 342 | device_initialize(dev); |
345 | starget->reap_ref = 1; | 343 | starget->reap_ref = 1; |