summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_transport_sas.c
diff options
context:
space:
mode:
authorJes Sorensen <jes@sgi.com>2006-01-16 10:31:18 -0500
committer <jejb@mulgrave.il.steeleye.com>2006-02-27 22:55:02 -0600
commit24669f75a3231fa37444977c92d1f4838bec1233 (patch)
tree3b64076b7d031aa31b95caeb512fb7e68b5fd28f /drivers/scsi/scsi_transport_sas.c
parentb9a33cebac70d6f67a769ce8d4078fee2b254ada (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_transport_sas.c')
-rw-r--r--drivers/scsi/scsi_transport_sas.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
index 210dab5879f..205542988e2 100644
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -391,10 +391,9 @@ struct sas_phy *sas_phy_alloc(struct device *parent, int number)
struct Scsi_Host *shost = dev_to_shost(parent);
struct sas_phy *phy;
- phy = kmalloc(sizeof(*phy), GFP_KERNEL);
+ phy = kzalloc(sizeof(*phy), GFP_KERNEL);
if (!phy)
return NULL;
- memset(phy, 0, sizeof(*phy));
get_device(parent);
@@ -585,12 +584,11 @@ struct sas_rphy *sas_rphy_alloc(struct sas_phy *parent)
struct Scsi_Host *shost = dev_to_shost(&parent->dev);
struct sas_rphy *rphy;
- rphy = kmalloc(sizeof(*rphy), GFP_KERNEL);
+ rphy = kzalloc(sizeof(*rphy), GFP_KERNEL);
if (!rphy) {
put_device(&parent->dev);
return NULL;
}
- memset(rphy, 0, sizeof(*rphy));
device_initialize(&rphy->dev);
rphy->dev.parent = get_device(&parent->dev);
@@ -793,10 +791,9 @@ sas_attach_transport(struct sas_function_template *ft)
struct sas_internal *i;
int count;
- i = kmalloc(sizeof(struct sas_internal), GFP_KERNEL);
+ i = kzalloc(sizeof(struct sas_internal), GFP_KERNEL);
if (!i)
return NULL;
- memset(i, 0, sizeof(struct sas_internal));
i->t.user_scan = sas_user_scan;