Skip to contentSkip to conversation

phy: berlin-sata: Use devm_kcalloc at appropriate place

PATCH In review Axel Lin 2 participants 2 messages Mar 5, 2015 – Mar 9, 2015 Generic PHY framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 phy: berlin-sata: Use devm_kcalloc at appropriate place

Prefer devm_kcalloc over devm_kzalloc with multiply.

---
 drivers/phy/phy-berlin-sata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/phy-berlin-sata.c +1 -1
index 099eee8..6f3e06d 100644
@@ -218,7 +218,7 @@ static int phy_berlin_sata_probe(struct platform_device *pdev)
 	if (priv->nphys == 0)
 		return -ENODEV;
 
-	priv->phys = devm_kzalloc(dev, priv->nphys * sizeof(*priv->phys),
+	priv->phys = devm_kcalloc(dev, priv->nphys, sizeof(*priv->phys),
 				  GFP_KERNEL);
 	if (!priv->phys)
 		return -ENOMEM;
Signature · 1 line
1.9.1
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Axel Lin

Prefer devm_kcalloc over devm_kzalloc with multiply.

Quoted 22 lines
---
 drivers/phy/phy-berlin-sata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/phy-berlin-sata.c +1 -1
index 099eee8..6f3e06d 100644
@@ -218,7 +218,7 @@ static int phy_berlin_sata_probe(struct platform_device *pdev)
 	if (priv->nphys == 0)
 		return -ENODEV;
 
-	priv->phys = devm_kzalloc(dev, priv->nphys * sizeof(*priv->phys),
+	priv->phys = devm_kcalloc(dev, priv->nphys, sizeof(*priv->phys),
 				  GFP_KERNEL);
 	if (!priv->phys)
 		return -ENOMEM;
Signature · 1 line
1.9.1
Signature · 3 lines
Antoine Ténart, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com