]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
gpio: stmpe: Improve a size determination in stmpe_gpio_probe()
authorMarkus Elfring <elfring@users.sourceforge.net>
Fri, 12 Jan 2018 18:36:29 +0000 (19:36 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 17 Jan 2018 06:44:15 +0000 (07:44 +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 <elfring@users.sourceforge.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-stmpe.c

index 8061c70c4b95a55c91b888b3605ab614cd89ebe5..b041c1768ecc28a3908d7b24614cca1c46cd7397 100644 (file)
@@ -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;