Thread (20 messages) flat view 20 messages, 7 authors, 2016-03-07
STALE3810d

[PATCH] fix noderef.cocci warnings

From: kbuild test robot <hidden>
Date: 2015-12-04 18:13:37
Also in: linux-arm-kernel, linux-samsung-soc, lkml

drivers/misc/gpio-switch.c:98:34-40: 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

CC: Martyn Welch <martyn.welch@collabora.co.uk>
Signed-off-by: Fengguang Wu <redacted>
---

 gpio-switch.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/misc/gpio-switch.c
+++ b/drivers/misc/gpio-switch.c
@@ -95,7 +95,7 @@ static int gpio_switch_probe(struct plat
 	if (i < 1)
 		return i;
 
-	gpios = devm_kmalloc(&pdev->dev, sizeof(gpios) * i, GFP_KERNEL);
+	gpios = devm_kmalloc(&pdev->dev, sizeof(*gpios) * i, GFP_KERNEL);
 	if (!gpios)
 		return -ENOMEM;
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help