Skip to contentSkip to conversation

drivers/scsi/pm8001: Use kzalloc for allocating only one thing

PATCH Applied Julia Lawall 2 participants 3 messages Dec 19, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 5/7 drivers/scsi/pm8001: Use kzalloc for allocating only one thing

From: Julia Lawall <[email protected]>

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>

---
 drivers/scsi/pm8001/pm8001_init.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/pm8001/pm8001_init.c 2009-12-19 07:52:44.000000000 +0100 renamed from drivers/scsi/pm8001/pm8001_init.c 2009-12-12 00:23:19.000000000 +0100 +1 -0
diff -u -p a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
@@ -654,7 +654,7 @@ static int __devinit pm8001_pci_probe(st
 	}
 	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;
#1 lore raw

Re: [PATCH 5/7] drivers/scsi/pm8001: Use kzalloc for allocating onlyone thing

RE:[PATCH 5/7] drivers/scsi/pm8001: Use kzalloc for allocating onlyone thing

From: Julia Lawall <[email protected]>

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>

---
 drivers/scsi/pm8001/pm8001_init.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/pm8001/pm8001_init.c 2009-12-19 07:52:44.000000000 +0100 renamed from drivers/scsi/pm8001/pm8001_init.c 2009-12-12 00:23:19.000000000 +0100 +1 -1
diff -u -p a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
@@ -654,7 +654,7 @@ static int __devinit pm8001_pci_probe(st
 	}
 	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;

[Jack]Acked-by:Jack Wang <[email protected]>
Thanks, Julia

#2 lore raw

Re: [PATCH 5/7] drivers/scsi/pm8001: Use kzalloc for allocating onlyone thing

In reply to Julia Lawall

RE:[PATCH 5/7] drivers/scsi/pm8001: Use kzalloc for allocating onlyone thing

From: Julia Lawall <[email protected]>

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>

---
 drivers/scsi/pm8001/pm8001_init.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/pm8001/pm8001_init.c 2009-12-19 07:52:44.000000000 +0100 renamed from drivers/scsi/pm8001/pm8001_init.c 2009-12-12 00:23:19.000000000 +0100 +1 -1
diff -u -p a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
@@ -654,7 +654,7 @@ static int __devinit pm8001_pci_probe(st
 	}
 	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;

[Jack]Acked-by:Jack Wang <[email protected]>
Thanks, Julia