iavf: Use kzalloc for allocating only one thing
authorZheng Yongjun <zhengyongjun3@huawei.com>
Tue, 29 Dec 2020 13:53:01 +0000 (21:53 +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/intel/iavf/iavf_virtchnl.c

index ed08ace..647e7fd 100644 (file)
@@ -911,7 +911,7 @@ static void iavf_print_link_message(struct iavf_adapter *adapter)
                return;
        }
 
-       speed = kcalloc(1, IAVF_MAX_SPEED_STRLEN, GFP_KERNEL);
+       speed = kzalloc(IAVF_MAX_SPEED_STRLEN, GFP_KERNEL);
        if (!speed)
                return;