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>
This commit is contained in:
Erick Archer 2024-06-02 21:30:36 -07:00 committed by Dmitry Torokhov
parent a0bd7adadb
commit dc2f1423f0
14 changed files with 15 additions and 16 deletions

View File

@ -3201,7 +3201,7 @@ int alps_detect(struct psmouse *psmouse, bool set_properties)
*/ */
psmouse_reset(psmouse); psmouse_reset(psmouse);
priv = kzalloc(sizeof(struct alps_data), GFP_KERNEL); priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;

View File

@ -855,7 +855,7 @@ static int atp_probe(struct usb_interface *iface,
} }
/* allocate memory for our device state and initialize it */ /* allocate memory for our device state and initialize it */
dev = kzalloc(sizeof(struct atp), GFP_KERNEL); dev = kzalloc(sizeof(*dev), GFP_KERNEL);
input_dev = input_allocate_device(); input_dev = input_allocate_device();
if (!dev || !input_dev) { if (!dev || !input_dev) {
dev_err(&iface->dev, "Out of memory\n"); dev_err(&iface->dev, "Out of memory\n");

View File

@ -904,7 +904,7 @@ static int bcm5974_probe(struct usb_interface *iface,
cfg = bcm5974_get_config(udev); cfg = bcm5974_get_config(udev);
/* allocate memory for our device state and initialize it */ /* allocate memory for our device state and initialize it */
dev = kzalloc(sizeof(struct bcm5974), GFP_KERNEL); dev = kzalloc(sizeof(*dev), GFP_KERNEL);
input_dev = input_allocate_device(); input_dev = input_allocate_device();
if (!dev || !input_dev) { if (!dev || !input_dev) {
dev_err(&iface->dev, "out of memory\n"); dev_err(&iface->dev, "out of memory\n");

View File

@ -659,7 +659,7 @@ int cypress_init(struct psmouse *psmouse)
{ {
struct cytp_data *cytp; struct cytp_data *cytp;
cytp = kzalloc(sizeof(struct cytp_data), GFP_KERNEL); cytp = kzalloc(sizeof(*cytp), GFP_KERNEL);
if (!cytp) if (!cytp)
return -ENOMEM; return -ENOMEM;

View File

@ -408,8 +408,7 @@ int focaltech_init(struct psmouse *psmouse)
struct focaltech_data *priv; struct focaltech_data *priv;
int error; int error;
psmouse->private = priv = kzalloc(sizeof(struct focaltech_data), psmouse->private = priv = kzalloc(sizeof(*priv), GFP_KERNEL);
GFP_KERNEL);
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;

View File

@ -981,7 +981,7 @@ int hgpk_init(struct psmouse *psmouse)
struct hgpk_data *priv; struct hgpk_data *priv;
int err; int err;
priv = kzalloc(sizeof(struct hgpk_data), GFP_KERNEL); priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (!priv) { if (!priv) {
err = -ENOMEM; err = -ENOMEM;
goto alloc_fail; goto alloc_fail;

View File

@ -273,7 +273,7 @@ static int lifebook_create_relative_device(struct psmouse *psmouse)
struct lifebook_data *priv; struct lifebook_data *priv;
int error = -ENOMEM; int error = -ENOMEM;
priv = kzalloc(sizeof(struct lifebook_data), GFP_KERNEL); priv = kzalloc(sizeof(*priv), GFP_KERNEL);
dev2 = input_allocate_device(); dev2 = input_allocate_device();
if (!priv || !dev2) if (!priv || !dev2)
goto err_out; goto err_out;

View File

@ -73,7 +73,7 @@ static int probe_maple_mouse(struct device *dev)
struct input_dev *input_dev; struct input_dev *input_dev;
struct dc_mouse *mse; struct dc_mouse *mse;
mse = kzalloc(sizeof(struct dc_mouse), GFP_KERNEL); mse = kzalloc(sizeof(*mse), GFP_KERNEL);
if (!mse) { if (!mse) {
error = -ENOMEM; error = -ENOMEM;
goto fail; goto fail;

View File

@ -1591,7 +1591,7 @@ static int psmouse_connect(struct serio *serio, struct serio_driver *drv)
psmouse_deactivate(parent); psmouse_deactivate(parent);
} }
psmouse = kzalloc(sizeof(struct psmouse), GFP_KERNEL); psmouse = kzalloc(sizeof(*psmouse), GFP_KERNEL);
input_dev = input_allocate_device(); input_dev = input_allocate_device();
if (!psmouse || !input_dev) if (!psmouse || !input_dev)
goto err_free; goto err_free;

View File

@ -1028,7 +1028,7 @@ int fsp_init(struct psmouse *psmouse)
"Finger Sensing Pad, hw: %d.%d.%d, sn: %x, sw: %s\n", "Finger Sensing Pad, hw: %d.%d.%d, sn: %x, sw: %s\n",
ver >> 4, ver & 0x0F, rev, sn, fsp_drv_ver); ver >> 4, ver & 0x0F, rev, sn, fsp_drv_ver);
psmouse->private = priv = kzalloc(sizeof(struct fsp_data), GFP_KERNEL); psmouse->private = priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;

View File

@ -231,7 +231,7 @@ static int sermouse_connect(struct serio *serio, struct serio_driver *drv)
unsigned char c = serio->id.extra; unsigned char c = serio->id.extra;
int err = -ENOMEM; int err = -ENOMEM;
sermouse = kzalloc(sizeof(struct sermouse), GFP_KERNEL); sermouse = kzalloc(sizeof(*sermouse), GFP_KERNEL);
input_dev = input_allocate_device(); input_dev = input_allocate_device();
if (!sermouse || !input_dev) if (!sermouse || !input_dev)
goto fail1; goto fail1;

View File

@ -708,7 +708,7 @@ static void synaptics_pt_create(struct psmouse *psmouse)
{ {
struct serio *serio; struct serio *serio;
serio = kzalloc(sizeof(struct serio), GFP_KERNEL); serio = kzalloc(sizeof(*serio), GFP_KERNEL);
if (!serio) { if (!serio) {
psmouse_err(psmouse, psmouse_err(psmouse,
"not enough memory for pass-through port\n"); "not enough memory for pass-through port\n");
@ -1563,7 +1563,7 @@ static int synaptics_init_ps2(struct psmouse *psmouse,
synaptics_apply_quirks(psmouse, info); synaptics_apply_quirks(psmouse, info);
psmouse->private = priv = kzalloc(sizeof(struct synaptics_data), GFP_KERNEL); psmouse->private = priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;

View File

@ -508,7 +508,7 @@ static struct synaptics_i2c *synaptics_i2c_touch_create(struct i2c_client *clien
{ {
struct synaptics_i2c *touch; struct synaptics_i2c *touch;
touch = kzalloc(sizeof(struct synaptics_i2c), GFP_KERNEL); touch = kzalloc(sizeof(*touch), GFP_KERNEL);
if (!touch) if (!touch)
return NULL; return NULL;

View File

@ -456,7 +456,7 @@ static int vsxxxaa_connect(struct serio *serio, struct serio_driver *drv)
struct input_dev *input_dev; struct input_dev *input_dev;
int err = -ENOMEM; int err = -ENOMEM;
mouse = kzalloc(sizeof(struct vsxxxaa), GFP_KERNEL); mouse = kzalloc(sizeof(*mouse), GFP_KERNEL);
input_dev = input_allocate_device(); input_dev = input_allocate_device();
if (!mouse || !input_dev) if (!mouse || !input_dev)
goto fail1; goto fail1;