From mboxrd@z Thu Jan 1 00:00:00 1970 From: kbuild test robot Subject: [PATCH] fix noderef.cocci warnings Date: Sat, 5 Dec 2015 02:14:48 +0800 Message-ID: <20151204181448.GA38784@lkp-sb04> References: <201512050224.lVULPyNu%fengguang.wu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1449250275-23435-3-git-send-email-martyn.welch@collabora.co.uk> Sender: linux-kernel-owner@vger.kernel.org Cc: kbuild-all@01.org, Arnd Bergmann , Greg Kroah-Hartman , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Russell King , Kukjin Kim , Krzysztof Kozlowski , Martyn Welch , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Olof Johansson List-Id: devicetree@vger.kernel.org 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 Signed-off-by: Fengguang Wu --- 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;