[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>
This commit is contained in:
Jes Sorensen
2006-01-16 10:31:18 -05:00
committed by
parent b9a33cebac
commit 24669f75a3
15 changed files with 30 additions and 59 deletions

View File

@@ -1115,15 +1115,13 @@ static int fc_user_scan(struct Scsi_Host *shost, uint channel,
struct scsi_transport_template *
fc_attach_transport(struct fc_function_template *ft)
{
struct fc_internal *i = kmalloc(sizeof(struct fc_internal),
GFP_KERNEL);
int count;
struct fc_internal *i = kzalloc(sizeof(struct fc_internal),
GFP_KERNEL);
if (unlikely(!i))
return NULL;
memset(i, 0, sizeof(struct fc_internal));
i->t.target_attrs.ac.attrs = &i->starget_attrs[0];
i->t.target_attrs.ac.class = &fc_transport_class.class;
i->t.target_attrs.ac.match = fc_target_match;
@@ -1305,12 +1303,11 @@ fc_rport_create(struct Scsi_Host *shost, int channel,
size_t size;
size = (sizeof(struct fc_rport) + fci->f->dd_fcrport_size);
rport = kmalloc(size, GFP_KERNEL);
rport = kzalloc(size, GFP_KERNEL);
if (unlikely(!rport)) {
printk(KERN_ERR "%s: allocation failure\n", __FUNCTION__);
return NULL;
}
memset(rport, 0, size);
rport->maxframe_size = -1;
rport->supported_classes = FC_COS_UNSPECIFIED;