linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wifi: ath12k: remove memset with byte count of 278528
@ 2023-02-22 16:40 Kalle Valo
  2023-02-24 10:23 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Kalle Valo @ 2023-02-22 16:40 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless

From: Kalle Valo <quic_kvalo@quicinc.com>

Sparse warns:

drivers/net/wireless/ath/ath12k/dp.c:1471:15: warning: memset with byte count of 278528

There's no need to use memset() here, instead call dma_alloc_coherent() with __GFP_ZERO.

While at it, remove an extra line before the error handler.

Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/dp.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/dp.c b/drivers/net/wireless/ath/ath12k/dp.c
index 9926d81c5fe4..ae1645d0f42a 100644
--- a/drivers/net/wireless/ath/ath12k/dp.c
+++ b/drivers/net/wireless/ath/ath12k/dp.c
@@ -1461,15 +1461,12 @@ static int ath12k_dp_reoq_lut_setup(struct ath12k_base *ab)
 	dp->reoq_lut.vaddr = dma_alloc_coherent(ab->dev,
 						DP_REOQ_LUT_SIZE,
 						&dp->reoq_lut.paddr,
-						GFP_KERNEL);
-
+						GFP_KERNEL | __GFP_ZERO);
 	if (!dp->reoq_lut.vaddr) {
 		ath12k_warn(ab, "failed to allocate memory for reoq table");
 		return -ENOMEM;
 	}
 
-	memset(dp->reoq_lut.vaddr, 0, DP_REOQ_LUT_SIZE);
-
 	ath12k_hif_write32(ab, HAL_SEQ_WCSS_UMAC_REO_REG + HAL_REO1_QDESC_LUT_BASE0(ab),
 			   dp->reoq_lut.paddr);
 	return 0;

base-commit: 5aa9ff08c0b71be15a607341fa5344546e19ceb2
-- 
2.30.2


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

* Re: [PATCH] wifi: ath12k: remove memset with byte count of 278528
  2023-02-22 16:40 [PATCH] wifi: ath12k: remove memset with byte count of 278528 Kalle Valo
@ 2023-02-24 10:23 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2023-02-24 10:23 UTC (permalink / raw)
  To: Kalle Valo; +Cc: ath12k, linux-wireless

Kalle Valo <kvalo@kernel.org> wrote:

> Sparse warns:
> 
> drivers/net/wireless/ath/ath12k/dp.c:1471:15: warning: memset with byte count of 278528
> 
> There's no need to use memset() here, instead call dma_alloc_coherent() with __GFP_ZERO.
> 
> While at it, remove an extra line before the error handler.
> 
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

Patch applied to ath-next branch of ath.git, thanks.

28013c356296 wifi: ath12k: remove memset with byte count of 278528

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20230222164014.860-1-kvalo@kernel.org/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

end of thread, other threads:[~2023-02-24 10:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-22 16:40 [PATCH] wifi: ath12k: remove memset with byte count of 278528 Kalle Valo
2023-02-24 10:23 ` Kalle Valo

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