]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
auxdisplay: Use sizeof(*pointer) instead of sizeof(type)
authorErick Archer <erick.archer@outlook.com>
Sun, 2 Jun 2024 08:49:22 +0000 (10:49 +0200)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 4 Jun 2024 07:29:36 +0000 (10:29 +0300)
It is preferred to use sizeof(*pointer) instead of sizeof(type)
due to the type of the variable can change and one needs not
change the former (unlike the latter). This patch has no effect
on runtime behavior.

Signed-off-by: Erick Archer <erick.archer@outlook.com>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/auxdisplay/arm-charlcd.c
drivers/auxdisplay/hd44780.c

index 0b1c99cca7334ff14b497f9c95709d1bacff0b9f..a7eae99a48f77d53de52132aed1640d6fd8fbcf5 100644 (file)
@@ -270,7 +270,7 @@ static int __init charlcd_probe(struct platform_device *pdev)
        struct charlcd *lcd;
        struct resource *res;
 
-       lcd = kzalloc(sizeof(struct charlcd), GFP_KERNEL);
+       lcd = kzalloc(sizeof(*lcd), GFP_KERNEL);
        if (!lcd)
                return -ENOMEM;
 
index 7ac0b1b1d5482fc788512bf3eec179fc563f8cd3..025dc6855cb253e45015d9ea95d681ddd6f6b97c 100644 (file)
@@ -230,7 +230,7 @@ static int hd44780_probe(struct platform_device *pdev)
        if (!lcd)
                goto fail1;
 
-       hd = kzalloc(sizeof(struct hd44780), GFP_KERNEL);
+       hd = kzalloc(sizeof(*hd), GFP_KERNEL);
        if (!hd)
                goto fail2;