]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
pinctrl: adi2: Improve a size determination in two functions
authorMarkus Elfring <elfring@users.sourceforge.net>
Wed, 20 Dec 2017 11:38:53 +0000 (12:38 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 21 Dec 2017 09:22:41 +0000 (10:22 +0100)
Replace the specification of data structures by variable references
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-adi2.c

index aefaf585508901ee86011ad1b28a4856ed119819..094a451db2a29beb81a92e062f5f8db98b77bc54 100644 (file)
@@ -827,9 +827,8 @@ static int adi_gpio_pint_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct resource *res;
-       struct gpio_pint *pint;
+       struct gpio_pint *pint = devm_kzalloc(dev, sizeof(*pint), GFP_KERNEL);
 
-       pint = devm_kzalloc(dev, sizeof(struct gpio_pint), GFP_KERNEL);
        if (!pint)
                return -ENOMEM;
 
@@ -943,7 +942,7 @@ static int adi_gpio_probe(struct platform_device *pdev)
        if (!pdata)
                return -EINVAL;
 
-       port = devm_kzalloc(dev, sizeof(struct gpio_port), GFP_KERNEL);
+       port = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL);
        if (!port)
                return -ENOMEM;