public inbox for ath12k@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH -next] wifi: ath12k: dp_mon: Fix unsigned comparison with less than zero
@ 2023-02-15  1:14 Yang Li
  2023-02-17 16:09 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2023-02-15  1:14 UTC (permalink / raw)
  To: kuba
  Cc: davem, kvalo, edumazet, pabeni, ath12k, linux-wireless, netdev,
	linux-kernel, Yang Li, Abaci Robot

The return value from the call to idr_alloc() is int.
However, the return value is being assigned to an unsigned
int variable 'buf_id', so making 'buf_id' an int.

Eliminate the following warning:
./drivers/net/wireless/ath/ath12k/dp_mon.c:1300:15-21: WARNING: Unsigned expression compared with zero: buf_id < 0

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4060
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/net/wireless/ath/ath12k/dp_mon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.c b/drivers/net/wireless/ath/ath12k/dp_mon.c
index a214797c96a2..8b3f0769dd58 100644
--- a/drivers/net/wireless/ath/ath12k/dp_mon.c
+++ b/drivers/net/wireless/ath/ath12k/dp_mon.c
@@ -1268,7 +1268,8 @@ int ath12k_dp_mon_buf_replenish(struct ath12k_base *ab,
 	struct sk_buff *skb;
 	struct hal_srng *srng;
 	dma_addr_t paddr;
-	u32 cookie, buf_id;
+	u32 cookie;
+	int buf_id;
 
 	srng = &ab->hal.srng_list[buf_ring->refill_buf_ring.ring_id];
 	spin_lock_bh(&srng->lock);
-- 
2.20.1.7.g153144c


-- 
ath12k mailing list
ath12k@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/ath12k

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

* Re: [PATCH -next] wifi: ath12k: dp_mon: Fix unsigned comparison with less than zero
  2023-02-15  1:14 [PATCH -next] wifi: ath12k: dp_mon: Fix unsigned comparison with less than zero Yang Li
@ 2023-02-17 16:09 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2023-02-17 16:09 UTC (permalink / raw)
  To: Yang Li
  Cc: kuba, davem, edumazet, pabeni, ath12k, linux-wireless, netdev,
	linux-kernel, Yang Li, Abaci Robot

Yang Li <yang.lee@linux.alibaba.com> wrote:

> The return value from the call to idr_alloc() is int.
> However, the return value is being assigned to an unsigned
> int variable 'buf_id', so making 'buf_id' an int.
> 
> Eliminate the following warning:
> ./drivers/net/wireless/ath/ath12k/dp_mon.c:1300:15-21: WARNING: Unsigned expression compared with zero: buf_id < 0
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4060
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

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

731e1b36656a wifi: ath12k: dp_mon: Fix unsigned comparison with less than zero

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20230215011453.73466-1-yang.lee@linux.alibaba.com/

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


-- 
ath12k mailing list
ath12k@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/ath12k

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

end of thread, other threads:[~2023-02-17 16:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-15  1:14 [PATCH -next] wifi: ath12k: dp_mon: Fix unsigned comparison with less than zero Yang Li
2023-02-17 16:09 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox