aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_transport_spi.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_spi.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_spi.c')
-rw-r--r--drivers/scsi/scsi_transport_spi.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
index 7ee95eb83dd..a1e521b58b6 100644
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -900,13 +900,11 @@ spi_dv_device(struct scsi_device *sdev)
900 if (unlikely(scsi_device_get(sdev))) 900 if (unlikely(scsi_device_get(sdev)))
901 return; 901 return;
902 902
903 buffer = kmalloc(len, GFP_KERNEL); 903 buffer = kzalloc(len, GFP_KERNEL);
904 904
905 if (unlikely(!buffer)) 905 if (unlikely(!buffer))
906 goto out_put; 906 goto out_put;
907 907
908 memset(buffer, 0, len);
909
910 /* We need to verify that the actual device will quiesce; the 908 /* We need to verify that the actual device will quiesce; the
911 * later target quiesce is just a nice to have */ 909 * later target quiesce is just a nice to have */
912 if (unlikely(scsi_device_quiesce(sdev))) 910 if (unlikely(scsi_device_quiesce(sdev)))
@@ -1265,15 +1263,13 @@ static DECLARE_ANON_TRANSPORT_CLASS(spi_device_class,
1265struct scsi_transport_template * 1263struct scsi_transport_template *
1266spi_attach_transport(struct spi_function_template *ft) 1264spi_attach_transport(struct spi_function_template *ft)
1267{ 1265{
1268 struct spi_internal *i = kmalloc(sizeof(struct spi_internal),
1269 GFP_KERNEL);
1270 int count = 0; 1266 int count = 0;
1267 struct spi_internal *i = kzalloc(sizeof(struct spi_internal),
1268 GFP_KERNEL);
1269
1271 if (unlikely(!i)) 1270 if (unlikely(!i))
1272 return NULL; 1271 return NULL;
1273 1272
1274 memset(i, 0, sizeof(struct spi_internal));
1275
1276
1277 i->t.target_attrs.ac.class = &spi_transport_class.class; 1273 i->t.target_attrs.ac.class = &spi_transport_class.class;
1278 i->t.target_attrs.ac.attrs = &i->attrs[0]; 1274 i->t.target_attrs.ac.attrs = &i->attrs[0];
1279 i->t.target_attrs.ac.match = spi_target_match; 1275 i->t.target_attrs.ac.match = spi_target_match;