[PATCH] fix noderef.cocci warnings

kbuild test robot lkp at intel.com
Fri Dec 4 10:14:48 PST 2015


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 at collabora.co.uk>
Signed-off-by: Fengguang Wu <fengguang.wu at intel.com>
---

 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;
 



More information about the linux-arm-kernel mailing list