[SCSI] pm8001: Use kzalloc for allocating only one thing
authorJulia Lawall <julia@diku.dk>
Sat, 19 Dec 2009 07:17:27 +0000 (08:17 +0100)
committerJames Bottomley <James.Bottomley@suse.de>
Mon, 18 Jan 2010 16:48:13 +0000 (10:48 -0600)
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
@@

- kcalloc(1,
+ kzalloc(
          ...)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by:Jack Wang <jack_wang@usish.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/pm8001/pm8001_init.c

index c2f1032496cb6acac2bdd8dba7192e52c75970d2..f80c1da8f6ca340b187ae08fc3a09e3341fe99b7 100644 (file)
@@ -654,7 +654,7 @@ static int __devinit pm8001_pci_probe(struct pci_dev *pdev,
        }
        chip = &pm8001_chips[ent->driver_data];
        SHOST_TO_SAS_HA(shost) =
-               kcalloc(1, sizeof(struct sas_ha_struct), GFP_KERNEL);
+               kzalloc(sizeof(struct sas_ha_struct), GFP_KERNEL);
        if (!SHOST_TO_SAS_HA(shost)) {
                rc = -ENOMEM;
                goto err_out_free_host;