summaryrefslogtreecommitdiff
path: root/drivers/input/joystick/gamecon.c
diff options
context:
space:
mode:
authorErick Archer <erick.archer@outlook.com>2024-06-08 17:13:57 +0200
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2024-06-09 14:38:43 -0700
commit4654c4cc7950440571d142e56db60106d84429d8 (patch)
tree20b371b02b20147eb5bb774fee22e003805a0dd1 /drivers/input/joystick/gamecon.c
parentf81d03d43965261056d963572d0335645008a8e8 (diff)
Input: joystick - 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). At the same time refactor the code to not use assignment in "if" conditions. This patch has no effect on runtime behavior. Signed-off-by: Erick Archer <erick.archer@outlook.com> Link: https://lore.kernel.org/r/AS8PR02MB7237FEA55FAC8A9453F2DA6F8BC42@AS8PR02MB7237.eurprd02.prod.outlook.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/joystick/gamecon.c')
-rw-r--r--drivers/input/joystick/gamecon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/input/joystick/gamecon.c b/drivers/input/joystick/gamecon.c
index 41d5dac05448..c38de3094553 100644
--- a/drivers/input/joystick/gamecon.c
+++ b/drivers/input/joystick/gamecon.c
@@ -950,7 +950,7 @@ static void gc_attach(struct parport *pp)
return;
}
- gc = kzalloc(sizeof(struct gc), GFP_KERNEL);
+ gc = kzalloc(sizeof(*gc), GFP_KERNEL);
if (!gc) {
pr_err("Not enough memory\n");
goto err_unreg_pardev;