Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965440AbeALUCq (ORCPT + 1 other); Fri, 12 Jan 2018 15:02:46 -0500 Received: from mout.web.de ([212.227.15.14]:58677 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965128AbeALUCo (ORCPT ); Fri, 12 Jan 2018 15:02:44 -0500 Subject: [PATCH 2/4] gpio-stmpe: Improve a size determination in stmpe_gpio_probe() From: SF Markus Elfring To: linux-gpio@vger.kernel.org, Linus Walleij Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: Date: Fri, 12 Jan 2018 21:02:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:c2DMDYOV4ytIBbEBrnzuIm5iZ21tJrXk7CVIPxfeBxp2Z0MfY1y lzVp4+CLhDd0rT/wexAyHC0+7ngBfWr6HA23cwWZ/GZ0adX5xXDOYzQ380J2IbXBI5ElGS7 p9rKFUmN39O9Tiycsp00sGEZ4E5VJNeMLHDJaEm/boadKdYxc+KlUTmtnwKsPnurQ8X61PZ EwdX8RANCWxiq+7F6rj8g== X-UI-Out-Filterresults: notjunk:1;V01:K0:o6wiFPjYjgE=:qfp30tz1kPtI1TKcpp3Qgr AqBERgMzNraUAxzRmEGJNgbja77tbNsOGEstfhknJyeZQklHxbiTOCwfdTB903+a1Ipe4kc53 YjLGERfF4j3MLlFtr8J+S3t2aN9gqNAsxbVZtMGNUSAv31YtcUJ/+3HxfoS70aj4jWpSs0ei5 2x5rz0GLU2HX5CePsj0q+xf8Guk+Apfu6coo1v2VudL5R5Y9IpeYZVOxxI4UTqQQ3xi3E3tzS KDF7uPkTcMIR3CaOyzyAu12mVzysxju3ZTYaVtTV0JreMaTiDD7G4sPJSgry/+kKujn7f5oP/ 5egl+CCsKcYs9H1LbY3LWiN6Krq/Ud6e9m1Yx0MC6zLr5tDwNT0nWmmDriIqn2gxSi1yNZmHd /XQ23kkuyXsjSONjC0P/lUk4eLhZar6ZfYld1zxgSiABvLI2mU2qIb/oZdZewVaCf3UNlmVKc xcSFeCO2fSWcsHnBEEj4Klea0paQrJCYt9/t9GTK9oseVV4m3qQ6yCzz+1NoQjInRpd8aRIao ih/9zPZrjhMB5FTOMD9SzdDdq67OcJNvEHweGQfrrQZ9YYJe0CFubDyEepvGt6RA9U6WOVaaO 3G8/J3+GYQg6PBS3cxI7A/fyLZfX5im1OgNkUVagtg4DIlgOQjHoALUTH+96ZPdvxoKoIDGut RxziyM3QM1qgoio/Ab/kysU4ePjG1699tvTmPgqUcvUvBY8xluVS6HzWpBK6XV5TGnrocUQQb fBNhFqFzwirvhMPITIAAOzyJr2iRwQ91VbT3V3eyXBYdBPP+sywjbjStnob323zfZz6zULW2/ /VBVBR93JIfP28sUyj9p4Jg7fqBJ8kwNfnag1Umgmi7FBF6Zyw= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Markus Elfring Date: Fri, 12 Jan 2018 19:36:29 +0100 Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/gpio/gpio-stmpe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c index 79858c6ad31a..2cf30dcba82a 100644 --- a/drivers/gpio/gpio-stmpe.c +++ b/drivers/gpio/gpio-stmpe.c @@ -437,7 +437,7 @@ static int stmpe_gpio_probe(struct platform_device *pdev) irq = platform_get_irq(pdev, 0); - stmpe_gpio = kzalloc(sizeof(struct stmpe_gpio), GFP_KERNEL); + stmpe_gpio = kzalloc(sizeof(*stmpe_gpio), GFP_KERNEL); if (!stmpe_gpio) return -ENOMEM; -- 2.15.1