liquidio: Use kzalloc for allocating only one thing
authorZheng Yongjun <zhengyongjun3@huawei.com>
Tue, 29 Dec 2020 13:52:54 +0000 (21:52 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Jan 2021 23:43:41 +0000 (15:43 -0800)
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
@@

- kcalloc(1,
+ kzalloc(
          ...)
// </smpl>

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cavium/liquidio/lio_core.c

index 37d064193f0feffb9af6da86760a81418949eb48..2a0d64e5797c87a6ce65bd1878e5600eca720e4d 100644 (file)
@@ -1163,7 +1163,7 @@ int octeon_setup_interrupt(struct octeon_device *oct, u32 num_ioqs)
                        oct->flags |= LIO_FLAG_MSI_ENABLED;
 
                /* allocate storage for the names assigned to the irq */
-               oct->irq_name_storage = kcalloc(1, INTRNAMSIZ, GFP_KERNEL);
+               oct->irq_name_storage = kzalloc(INTRNAMSIZ, GFP_KERNEL);
                if (!oct->irq_name_storage)
                        return -ENOMEM;