Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: gameport - 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 <erick.archer@outlook.com>
Link: https://lore.kernel.org/r/PAXPR02MB72483F512F863C74A4AECA2B8BFB2@PAXPR02MB7248.eurprd02.prod.outlook.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Erick Archer and committed by
Dmitry Torokhov
5bbcece6 06b449d7

+5 -5
+1 -1
drivers/input/gameport/emu10k1-gp.c
··· 43 43 struct gameport *port; 44 44 int error; 45 45 46 - emu = kzalloc(sizeof(struct emu), GFP_KERNEL); 46 + emu = kzalloc(sizeof(*emu), GFP_KERNEL); 47 47 port = gameport_allocate_port(); 48 48 if (!emu || !port) { 49 49 printk(KERN_ERR "emu10k1-gp: Memory allocation failed\n");
+1 -1
drivers/input/gameport/fm801-gp.c
··· 68 68 struct gameport *port; 69 69 int error; 70 70 71 - gp = kzalloc(sizeof(struct fm801_gp), GFP_KERNEL); 71 + gp = kzalloc(sizeof(*gp), GFP_KERNEL); 72 72 port = gameport_allocate_port(); 73 73 if (!gp || !port) { 74 74 printk(KERN_ERR "fm801-gp: Memory allocation failed\n");
+1 -1
drivers/input/gameport/gameport.c
··· 372 372 } 373 373 } 374 374 375 - event = kmalloc(sizeof(struct gameport_event), GFP_ATOMIC); 375 + event = kmalloc(sizeof(*event), GFP_ATOMIC); 376 376 if (!event) { 377 377 pr_err("Not enough memory to queue event %d\n", event_type); 378 378 retval = -ENOMEM;
+2 -2
drivers/input/gameport/ns558.c
··· 120 120 return -EBUSY; 121 121 } 122 122 123 - ns558 = kzalloc(sizeof(struct ns558), GFP_KERNEL); 123 + ns558 = kzalloc(sizeof(*ns558), GFP_KERNEL); 124 124 port = gameport_allocate_port(); 125 125 if (!ns558 || !port) { 126 126 printk(KERN_ERR "ns558: Memory allocation failed.\n"); ··· 192 192 if (!request_region(ioport, iolen, "ns558-pnp")) 193 193 return -EBUSY; 194 194 195 - ns558 = kzalloc(sizeof(struct ns558), GFP_KERNEL); 195 + ns558 = kzalloc(sizeof(*ns558), GFP_KERNEL); 196 196 port = gameport_allocate_port(); 197 197 if (!ns558 || !port) { 198 198 printk(KERN_ERR "ns558: Memory allocation failed\n");