Skip to content

Commit

Permalink
bnxt_en: 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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Zheng Yongjun authored and David S. Miller committed Jan 5, 2021
1 parent c75857b commit 33dbcf6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/broadcom/bnxt/bnxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -8603,7 +8603,7 @@ static int bnxt_init_msix(struct bnxt *bp)

static int bnxt_init_inta(struct bnxt *bp)
{
bp->irq_tbl = kcalloc(1, sizeof(struct bnxt_irq), GFP_KERNEL);
bp->irq_tbl = kzalloc(sizeof(struct bnxt_irq), GFP_KERNEL);
if (!bp->irq_tbl)
return -ENOMEM;

Expand Down

0 comments on commit 33dbcf6

Please sign in to comment.