Skip to content

Commit

Permalink
auxdisplay: Use sizeof(*pointer) instead of sizeof(type)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Erick Archer authored and Andy Shevchenko committed Jun 4, 2024
1 parent c56a450 commit 632691a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/auxdisplay/arm-charlcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion drivers/auxdisplay/hd44780.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 632691a

Please sign in to comment.