From 72aa1ac1dd75c77352780c55bf1058c7a2abc09c Mon Sep 17 00:00:00 2001 From: Jakub Kicinski Date: Thu, 7 May 2015 13:34:57 +0200 Subject: [PATCH] don't compare .hw_key_idx to negative values .hw_key_idx is defined as u8 and set to -1 when there is no key. However, we cannot compare to -1 because of the unsigned type. Signed-off-by: Jakub Kicinski --- dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dma.c b/dma.c index f32a2f75..41b3c983 100644 --- a/dma.c +++ b/dma.c @@ -238,7 +238,7 @@ int mt76_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q, MT76_SET(MT_TXD_INFO_QSEL, qsel) | MT_TXD_INFO_80211; - if (!wcid || wcid->hw_key_idx < 0) + if (!wcid || wcid->hw_key_idx == 0xff) tx_info |= MT_TXD_INFO_WIV; addr = dma_map_single(dev->dev, skb->data, skb->len, DMA_TO_DEVICE);