* [PATCH net-next] net/mlxfw: Use kzalloc for allocating only one thing
@ 2020-12-30 8:18 Zheng Yongjun
2020-12-30 10:49 ` Ido Schimmel
2021-01-06 0:01 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Zheng Yongjun @ 2020-12-30 8:18 UTC (permalink / raw)
To: davem, kuba, netdev, linux-kernel; +Cc: mlxsw, Zheng Yongjun
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>
---
drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c b/drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c
index 5d9ddf36fb4e..e6f677e42007 100644
--- a/drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c
+++ b/drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c
@@ -267,7 +267,7 @@ struct mlxfw_mfa2_file *mlxfw_mfa2_file_init(const struct firmware *fw)
const void *first_tlv_ptr;
const void *cb_top_ptr;
- mfa2_file = kcalloc(1, sizeof(*mfa2_file), GFP_KERNEL);
+ mfa2_file = kzalloc(sizeof(*mfa2_file), GFP_KERNEL);
if (!mfa2_file)
return ERR_PTR(-ENOMEM);
--
2.22.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net/mlxfw: Use kzalloc for allocating only one thing
2020-12-30 8:18 [PATCH net-next] net/mlxfw: Use kzalloc for allocating only one thing Zheng Yongjun
@ 2020-12-30 10:49 ` Ido Schimmel
2021-01-06 0:01 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Ido Schimmel @ 2020-12-30 10:49 UTC (permalink / raw)
To: Zheng Yongjun; +Cc: davem, kuba, netdev, linux-kernel, mlxsw
On Wed, Dec 30, 2020 at 04:18:35PM +0800, Zheng Yongjun wrote:
> 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>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net/mlxfw: Use kzalloc for allocating only one thing
2020-12-30 8:18 [PATCH net-next] net/mlxfw: Use kzalloc for allocating only one thing Zheng Yongjun
2020-12-30 10:49 ` Ido Schimmel
@ 2021-01-06 0:01 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2021-01-06 0:01 UTC (permalink / raw)
To: zhengyongjun3; +Cc: kuba, netdev, linux-kernel, mlxsw
From: Zheng Yongjun <zhengyongjun3@huawei.com>
Date: Wed, 30 Dec 2020 16:18:35 +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>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-06 0:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-30 8:18 [PATCH net-next] net/mlxfw: Use kzalloc for allocating only one thing Zheng Yongjun
2020-12-30 10:49 ` Ido Schimmel
2021-01-06 0:01 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).