Skip to content

Commit

Permalink
net/mlxfw: Use kzalloc for allocating only one thing
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Zheng Yongjun authored and David S. Miller committed Jan 6, 2021
1 parent db471ed commit 8407b23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 8407b23

Please sign in to comment.