Input: tablet - use sizeof(*pointer) instead of sizeof(type)
authorErick Archer <erick.archer@outlook.com>
Mon, 3 Jun 2024 04:30:48 +0000 (21:30 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 3 Jun 2024 04:32:03 +0000 (21:32 -0700)
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/AS8PR02MB7237B05083487507CFAF96B08BFE2@AS8PR02MB7237.eurprd02.prod.outlook.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/tablet/acecad.c
drivers/input/tablet/aiptek.c
drivers/input/tablet/hanwang.c
drivers/input/tablet/kbtab.c
drivers/input/tablet/wacom_serial4.c

index b20e5a1afbccafa01be89142271f40af4f23e0ad..0ac16f32b31f9750c1ed314b783c67d68442874a 100644 (file)
@@ -129,7 +129,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
        pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress);
        maxp = usb_maxpacket(dev, pipe);
 
-       acecad = kzalloc(sizeof(struct usb_acecad), GFP_KERNEL);
+       acecad = kzalloc(sizeof(*acecad), GFP_KERNEL);
        input_dev = input_allocate_device();
        if (!acecad || !input_dev) {
                err = -ENOMEM;
index baabc51547b83d6f4c9d6d559e07d6d1e2aaa56f..2d176fbab25119f887b449f54aa98aad3fa39293 100644 (file)
@@ -1673,7 +1673,7 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
         */
        speeds[0] = programmableDelay;
 
-       aiptek = kzalloc(sizeof(struct aiptek), GFP_KERNEL);
+       aiptek = kzalloc(sizeof(*aiptek), GFP_KERNEL);
        inputdev = input_allocate_device();
        if (!aiptek || !inputdev) {
                dev_warn(&intf->dev,
index 9bc631518b92ddcc9cd989637c094033e0189702..42c1e5eaddd50a13588c5e51d003ff97350c9ffa 100644 (file)
@@ -322,7 +322,7 @@ static int hanwang_probe(struct usb_interface *intf, const struct usb_device_id
        if (intf->cur_altsetting->desc.bNumEndpoints < 1)
                return -ENODEV;
 
-       hanwang = kzalloc(sizeof(struct hanwang), GFP_KERNEL);
+       hanwang = kzalloc(sizeof(*hanwang), GFP_KERNEL);
        input_dev = input_allocate_device();
        if (!hanwang || !input_dev) {
                error = -ENOMEM;
index aa577898e952b48c495f3214abd690a80106df99..38d36d25f6f4656d4b72211a2982014827a62e68 100644 (file)
@@ -121,7 +121,7 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i
        if (!usb_endpoint_is_int_in(endpoint))
                return -ENODEV;
 
-       kbtab = kzalloc(sizeof(struct kbtab), GFP_KERNEL);
+       kbtab = kzalloc(sizeof(*kbtab), GFP_KERNEL);
        input_dev = input_allocate_device();
        if (!kbtab || !input_dev)
                goto fail1;
index 1cedb45ba49702e03bb94106f67ff540fab62326..cf7cea77dabc2f27e5c7560d805cc4ba14749dd4 100644 (file)
@@ -521,7 +521,7 @@ static int wacom_connect(struct serio *serio, struct serio_driver *drv)
        struct input_dev *input_dev;
        int err = -ENOMEM;
 
-       wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL);
+       wacom = kzalloc(sizeof(*wacom), GFP_KERNEL);
        input_dev = input_allocate_device();
        if (!wacom || !input_dev)
                goto free_device;