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

Input: mouse - 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/AS8PR02MB7237FB736DBF67A58798FDF38BFE2@AS8PR02MB7237.eurprd02.prod.outlook.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Erick Archer and committed by
Dmitry Torokhov
dc2f1423 a0bd7ada

+15 -16
+1 -1
drivers/input/mouse/alps.c
··· 3201 3201 */ 3202 3202 psmouse_reset(psmouse); 3203 3203 3204 - priv = kzalloc(sizeof(struct alps_data), GFP_KERNEL); 3204 + priv = kzalloc(sizeof(*priv), GFP_KERNEL); 3205 3205 if (!priv) 3206 3206 return -ENOMEM; 3207 3207
+1 -1
drivers/input/mouse/appletouch.c
··· 855 855 } 856 856 857 857 /* allocate memory for our device state and initialize it */ 858 - dev = kzalloc(sizeof(struct atp), GFP_KERNEL); 858 + dev = kzalloc(sizeof(*dev), GFP_KERNEL); 859 859 input_dev = input_allocate_device(); 860 860 if (!dev || !input_dev) { 861 861 dev_err(&iface->dev, "Out of memory\n");
+1 -1
drivers/input/mouse/bcm5974.c
··· 904 904 cfg = bcm5974_get_config(udev); 905 905 906 906 /* allocate memory for our device state and initialize it */ 907 - dev = kzalloc(sizeof(struct bcm5974), GFP_KERNEL); 907 + dev = kzalloc(sizeof(*dev), GFP_KERNEL); 908 908 input_dev = input_allocate_device(); 909 909 if (!dev || !input_dev) { 910 910 dev_err(&iface->dev, "out of memory\n");
+1 -1
drivers/input/mouse/cypress_ps2.c
··· 659 659 { 660 660 struct cytp_data *cytp; 661 661 662 - cytp = kzalloc(sizeof(struct cytp_data), GFP_KERNEL); 662 + cytp = kzalloc(sizeof(*cytp), GFP_KERNEL); 663 663 if (!cytp) 664 664 return -ENOMEM; 665 665
+1 -2
drivers/input/mouse/focaltech.c
··· 408 408 struct focaltech_data *priv; 409 409 int error; 410 410 411 - psmouse->private = priv = kzalloc(sizeof(struct focaltech_data), 412 - GFP_KERNEL); 411 + psmouse->private = priv = kzalloc(sizeof(*priv), GFP_KERNEL); 413 412 if (!priv) 414 413 return -ENOMEM; 415 414
+1 -1
drivers/input/mouse/hgpk.c
··· 981 981 struct hgpk_data *priv; 982 982 int err; 983 983 984 - priv = kzalloc(sizeof(struct hgpk_data), GFP_KERNEL); 984 + priv = kzalloc(sizeof(*priv), GFP_KERNEL); 985 985 if (!priv) { 986 986 err = -ENOMEM; 987 987 goto alloc_fail;
+1 -1
drivers/input/mouse/lifebook.c
··· 273 273 struct lifebook_data *priv; 274 274 int error = -ENOMEM; 275 275 276 - priv = kzalloc(sizeof(struct lifebook_data), GFP_KERNEL); 276 + priv = kzalloc(sizeof(*priv), GFP_KERNEL); 277 277 dev2 = input_allocate_device(); 278 278 if (!priv || !dev2) 279 279 goto err_out;
+1 -1
drivers/input/mouse/maplemouse.c
··· 73 73 struct input_dev *input_dev; 74 74 struct dc_mouse *mse; 75 75 76 - mse = kzalloc(sizeof(struct dc_mouse), GFP_KERNEL); 76 + mse = kzalloc(sizeof(*mse), GFP_KERNEL); 77 77 if (!mse) { 78 78 error = -ENOMEM; 79 79 goto fail;
+1 -1
drivers/input/mouse/psmouse-base.c
··· 1591 1591 psmouse_deactivate(parent); 1592 1592 } 1593 1593 1594 - psmouse = kzalloc(sizeof(struct psmouse), GFP_KERNEL); 1594 + psmouse = kzalloc(sizeof(*psmouse), GFP_KERNEL); 1595 1595 input_dev = input_allocate_device(); 1596 1596 if (!psmouse || !input_dev) 1597 1597 goto err_free;
+1 -1
drivers/input/mouse/sentelic.c
··· 1028 1028 "Finger Sensing Pad, hw: %d.%d.%d, sn: %x, sw: %s\n", 1029 1029 ver >> 4, ver & 0x0F, rev, sn, fsp_drv_ver); 1030 1030 1031 - psmouse->private = priv = kzalloc(sizeof(struct fsp_data), GFP_KERNEL); 1031 + psmouse->private = priv = kzalloc(sizeof(*priv), GFP_KERNEL); 1032 1032 if (!priv) 1033 1033 return -ENOMEM; 1034 1034
+1 -1
drivers/input/mouse/sermouse.c
··· 231 231 unsigned char c = serio->id.extra; 232 232 int err = -ENOMEM; 233 233 234 - sermouse = kzalloc(sizeof(struct sermouse), GFP_KERNEL); 234 + sermouse = kzalloc(sizeof(*sermouse), GFP_KERNEL); 235 235 input_dev = input_allocate_device(); 236 236 if (!sermouse || !input_dev) 237 237 goto fail1;
+2 -2
drivers/input/mouse/synaptics.c
··· 708 708 { 709 709 struct serio *serio; 710 710 711 - serio = kzalloc(sizeof(struct serio), GFP_KERNEL); 711 + serio = kzalloc(sizeof(*serio), GFP_KERNEL); 712 712 if (!serio) { 713 713 psmouse_err(psmouse, 714 714 "not enough memory for pass-through port\n"); ··· 1563 1563 1564 1564 synaptics_apply_quirks(psmouse, info); 1565 1565 1566 - psmouse->private = priv = kzalloc(sizeof(struct synaptics_data), GFP_KERNEL); 1566 + psmouse->private = priv = kzalloc(sizeof(*priv), GFP_KERNEL); 1567 1567 if (!priv) 1568 1568 return -ENOMEM; 1569 1569
+1 -1
drivers/input/mouse/synaptics_i2c.c
··· 508 508 { 509 509 struct synaptics_i2c *touch; 510 510 511 - touch = kzalloc(sizeof(struct synaptics_i2c), GFP_KERNEL); 511 + touch = kzalloc(sizeof(*touch), GFP_KERNEL); 512 512 if (!touch) 513 513 return NULL; 514 514
+1 -1
drivers/input/mouse/vsxxxaa.c
··· 456 456 struct input_dev *input_dev; 457 457 int err = -ENOMEM; 458 458 459 - mouse = kzalloc(sizeof(struct vsxxxaa), GFP_KERNEL); 459 + mouse = kzalloc(sizeof(*mouse), GFP_KERNEL); 460 460 input_dev = input_allocate_device(); 461 461 if (!mouse || !input_dev) 462 462 goto fail1;