From 24669f75a3231fa37444977c92d1f4838bec1233 Mon Sep 17 00:00:00 2001 From: Jes Sorensen Date: Mon, 16 Jan 2006 10:31:18 -0500 Subject: [SCSI] SCSI core kmalloc2kzalloc Change the core SCSI code to use kzalloc rather than kmalloc+memset where possible. Signed-off-by: Jes Sorensen Signed-off-by: James Bottomley --- drivers/scsi/scsi_transport_spi.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'drivers/scsi/scsi_transport_spi.c') diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index 7ee95eb83dda..a1e521b58b67 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) if (unlikely(scsi_device_get(sdev))) return; - buffer = kmalloc(len, GFP_KERNEL); + buffer = kzalloc(len, GFP_KERNEL); if (unlikely(!buffer)) goto out_put; - memset(buffer, 0, len); - /* We need to verify that the actual device will quiesce; the * later target quiesce is just a nice to have */ if (unlikely(scsi_device_quiesce(sdev))) @@ -1265,15 +1263,13 @@ static DECLARE_ANON_TRANSPORT_CLASS(spi_device_class, struct scsi_transport_template * spi_attach_transport(struct spi_function_template *ft) { - struct spi_internal *i = kmalloc(sizeof(struct spi_internal), - GFP_KERNEL); int count = 0; + struct spi_internal *i = kzalloc(sizeof(struct spi_internal), + GFP_KERNEL); + if (unlikely(!i)) return NULL; - memset(i, 0, sizeof(struct spi_internal)); - - i->t.target_attrs.ac.class = &spi_transport_class.class; i->t.target_attrs.ac.attrs = &i->attrs[0]; i->t.target_attrs.ac.match = spi_target_match; -- cgit v1.2.3