diff mbox series

brcmfmac: Remove always false 'idx < 0' statement

Message ID 20200108135748.46096-1-yuehaibing@huawei.com (mailing list archive)
State Accepted
Commit 627b0d094240c38393b2f2d40626c33a8fff6103
Delegated to: Kalle Valo
Headers show
Series brcmfmac: Remove always false 'idx < 0' statement | expand

Commit Message

Yue Haibing Jan. 8, 2020, 1:57 p.m. UTC
From: yuehaibing <yuehaibing@huawei.com>

idx is declared as u32, it will never less than 0.

Signed-off-by: yuehaibing <yuehaibing@huawei.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kalle Valo Jan. 26, 2020, 3:43 p.m. UTC | #1
YueHaibing <yuehaibing@huawei.com> wrote:

> From: yuehaibing <yuehaibing@huawei.com>
> 
> idx is declared as u32, it will never less than 0.
> 
> Signed-off-by: yuehaibing <yuehaibing@huawei.com>

Patch applied to wireless-drivers-next.git, thanks.

627b0d094240 brcmfmac: Remove always false 'idx < 0' statement
diff mbox series

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
index e3dd862..8bb4f1f 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
@@ -365,7 +365,7 @@  brcmf_msgbuf_get_pktid(struct device *dev, struct brcmf_msgbuf_pktids *pktids,
 	struct brcmf_msgbuf_pktid *pktid;
 	struct sk_buff *skb;
 
-	if (idx < 0 || idx >= pktids->array_size) {
+	if (idx >= pktids->array_size) {
 		brcmf_err("Invalid packet id %d (max %d)\n", idx,
 			  pktids->array_size);
 		return NULL;