Skip to content

Commit 632691a

Browse files
Erick Archerandy-shev
authored andcommitted
auxdisplay: Use sizeof(*pointer) instead of sizeof(type)
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 <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
1 parent c56a450 commit 632691a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/auxdisplay/arm-charlcd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ static int __init charlcd_probe(struct platform_device *pdev)
270270
struct charlcd *lcd;
271271
struct resource *res;
272272

273-
lcd = kzalloc(sizeof(struct charlcd), GFP_KERNEL);
273+
lcd = kzalloc(sizeof(*lcd), GFP_KERNEL);
274274
if (!lcd)
275275
return -ENOMEM;
276276

drivers/auxdisplay/hd44780.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ static int hd44780_probe(struct platform_device *pdev)
230230
if (!lcd)
231231
goto fail1;
232232

233-
hd = kzalloc(sizeof(struct hd44780), GFP_KERNEL);
233+
hd = kzalloc(sizeof(*hd), GFP_KERNEL);
234234
if (!hd)
235235
goto fail2;
236236

0 commit comments

Comments
 (0)