From: Yang Li Date: Wed, 15 Feb 2023 18:31:37 +0000 (+0200) Subject: wifi: ath12k: dp_mon: Fix unsigned comparison with less than zero X-Git-Tag: v6.4-rc1~132^2~151^2~135^2~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=731e1b36656a30ffa9c77de673695cdc733d6c92;p=thirdparty%2Fkernel%2Flinux.git 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 Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4060 Signed-off-by: Yang Li Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230215011453.73466-1-yang.lee@linux.alibaba.com --- diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.c b/drivers/net/wireless/ath/ath12k/dp_mon.c index 4f93e4c95fed2..85f8f802340dd 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);