Skip to contentSkip to conversation

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

PATCH In review Yang Li 2 participants 2 messages Feb 15, 2023 – Feb 17, 2023

Subsystems (3)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 wifi: ath12k: dp_mon: Fix unsigned comparison with less than zero

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

---
 drivers/net/wireless/ath/ath12k/dp_mon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath12k/dp_mon.c +2 -1
index a214797c96a2..8b3f0769dd58 100644
@@ -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);
Signature · 7 lines
2.20.1.7.g153144c


-- 
ath12k mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/ath12k
#1 lore raw
Quoted 11 lines · Yang Li

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

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

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

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

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