aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_transport_fc.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 23:55:02 -0500
commit24669f75a3231fa37444977c92d1f4838bec1233 (patch)
tree3b64076b7d031aa31b95caeb512fb7e68b5fd28f /drivers/scsi/scsi_transport_fc.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_fc.c')
-rw-r--r--drivers/scsi/scsi_transport_fc.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index f2c9acf11bd0..56012b2694d2 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -1115,15 +1115,13 @@ static int fc_user_scan(struct Scsi_Host *shost, uint channel,
1115struct scsi_transport_template * 1115struct scsi_transport_template *
1116fc_attach_transport(struct fc_function_template *ft) 1116fc_attach_transport(struct fc_function_template *ft)
1117{ 1117{
1118 struct fc_internal *i = kmalloc(sizeof(struct fc_internal),
1119 GFP_KERNEL);
1120 int count; 1118 int count;
1119 struct fc_internal *i = kzalloc(sizeof(struct fc_internal),
1120 GFP_KERNEL);
1121 1121
1122 if (unlikely(!i)) 1122 if (unlikely(!i))
1123 return NULL; 1123 return NULL;
1124 1124
1125 memset(i, 0, sizeof(struct fc_internal));
1126
1127 i->t.target_attrs.ac.attrs = &i->starget_attrs[0]; 1125 i->t.target_attrs.ac.attrs = &i->starget_attrs[0];
1128 i->t.target_attrs.ac.class = &fc_transport_class.class; 1126 i->t.target_attrs.ac.class = &fc_transport_class.class;
1129 i->t.target_attrs.ac.match = fc_target_match; 1127 i->t.target_attrs.ac.match = fc_target_match;
@@ -1305,12 +1303,11 @@ fc_rport_create(struct Scsi_Host *shost, int channel,
1305 size_t size; 1303 size_t size;
1306 1304
1307 size = (sizeof(struct fc_rport) + fci->f->dd_fcrport_size); 1305 size = (sizeof(struct fc_rport) + fci->f->dd_fcrport_size);
1308 rport = kmalloc(size, GFP_KERNEL); 1306 rport = kzalloc(size, GFP_KERNEL);
1309 if (unlikely(!rport)) { 1307 if (unlikely(!rport)) {
1310 printk(KERN_ERR "%s: allocation failure\n", __FUNCTION__); 1308 printk(KERN_ERR "%s: allocation failure\n", __FUNCTION__);
1311 return NULL; 1309 return NULL;
1312 } 1310 }
1313 memset(rport, 0, size);
1314 1311
1315 rport->maxframe_size = -1; 1312 rport->maxframe_size = -1;
1316 rport->supported_classes = FC_COS_UNSPECIFIED; 1313 rport->supported_classes = FC_COS_UNSPECIFIED;