linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] bnxt_en: Remove superfluous memset()
@ 2020-07-30  6:43 Li Heng
  2020-07-31  0:41 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Li Heng @ 2020-07-30  6:43 UTC (permalink / raw)
  To: michael.chan, davem, kuba; +Cc: netdev, linux-kernel

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>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 2622d3c..31fb5a2 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -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;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] bnxt_en: Remove superfluous memset()
  2020-07-30  6:43 [PATCH -next] bnxt_en: Remove superfluous memset() Li Heng
@ 2020-07-31  0:41 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-07-31  0:41 UTC (permalink / raw)
  To: liheng40; +Cc: michael.chan, kuba, netdev, linux-kernel

From: Li Heng <liheng40@huawei.com>
Date: Thu, 30 Jul 2020 14:43:50 +0800

> 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>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-31  0:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-30  6:43 [PATCH -next] bnxt_en: Remove superfluous memset() Li Heng
2020-07-31  0:41 ` 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).