Skip to content

Commit

Permalink
bnxt_en: Remove superfluous memset()
Browse files Browse the repository at this point in the history
Fixes coccicheck warning:

./drivers/net/ethernet/broadcom/bnxt/bnxt.c:3730:19-37: WARNING:
dma_alloc_coherent use in stats -> hw_stats already zeroes out
memory,  so memset is not needed

dma_alloc_coherent use in status already zeroes out memory,
so memset is not needed

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Li Heng <liheng40@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Li Heng authored and David S. Miller committed Jul 31, 2020
1 parent 1e51f93 commit bbf1b94
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/net/ethernet/broadcom/bnxt/bnxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -3732,8 +3732,6 @@ static int bnxt_alloc_stats_mem(struct bnxt *bp, struct bnxt_stats_mem *stats,
if (!stats->hw_stats)
return -ENOMEM;

memset(stats->hw_stats, 0, stats->len);

stats->sw_stats = kzalloc(stats->len, GFP_KERNEL);
if (!stats->sw_stats)
goto stats_mem_err;
Expand Down

0 comments on commit bbf1b94

Please sign in to comment.