staging: vchiq_arm: Prefer kzalloc(sizeof(*waiter)...)
authorStefan Wahren <stefan.wahren@i2se.com>
Sat, 15 May 2021 19:10:49 +0000 (21:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 May 2021 15:56:31 +0000 (17:56 +0200)
It's shorter and easier to maintain. This has been found with checkpatch.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621105859-30215-11-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c

index e2c99aab891803dbc2b7ac30d455d55758db0a68..d1dfec7d93e85ebd715a7e38b09a9e64e39acac7 100644 (file)
@@ -459,7 +459,7 @@ vchiq_blocking_bulk_transfer(unsigned int handle, void *data,
                        }
                }
        } else {
-               waiter = kzalloc(sizeof(struct bulk_waiter_node), GFP_KERNEL);
+               waiter = kzalloc(sizeof(*waiter), GFP_KERNEL);
                if (!waiter) {
                        vchiq_log_error(vchiq_core_log_level,
                                "%s - out of memory", __func__);
@@ -962,8 +962,7 @@ static int vchiq_irq_queue_bulk_tx_rx(struct vchiq_instance *instance,
                return -EINVAL;
 
        if (args->mode == VCHIQ_BULK_MODE_BLOCKING) {
-               waiter = kzalloc(sizeof(struct bulk_waiter_node),
-                       GFP_KERNEL);
+               waiter = kzalloc(sizeof(*waiter), GFP_KERNEL);
                if (!waiter) {
                        ret = -ENOMEM;
                        goto out;