Skip to contentSkip to conversation

net: phy: at803x: fix coccinelle warnings

PATCH Applied Daniel Mack 2 participants 2 messages Jun 22, 2014 – Jun 23, 2014

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

PATCH 1/1 net: phy: at803x: fix coccinelle warnings

From: Fengguang Wu <[email protected]>

drivers/net/phy/at803x.c:196:26-32: ERROR: application of sizeof to pointer

sizeof when applied to a pointer typed expression gives the size of the pointer

Generated by: scripts/coccinelle/misc/noderef.cocci

---
 drivers/net/phy/at803x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/at803x.c +1 -1
index 3cbd82f..fdc1b41 100644
@@ -193,7 +193,7 @@ static int at803x_probe(struct phy_device *phydev)
 	struct device *dev = &phydev->dev;
 	struct at803x_priv *priv;
 
-	priv = devm_kzalloc(dev, sizeof(priv), GFP_KERNEL);
+	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
 		return -ENOMEM;
 
Signature · 1 line
1.9.3
maintainer Applied
#1 lore raw

From: Daniel Mack <[email protected]>
Date: Sun, 22 Jun 2014 12:32:51 +0200

Quoted 11 lines

From: Fengguang Wu <[email protected]>

drivers/net/phy/at803x.c:196:26-32: ERROR: application of sizeof to pointer

sizeof when applied to a pointer typed expression gives the size of the pointer

Generated by: scripts/coccinelle/misc/noderef.cocci

Applied, thank you.