diff mbox series

mt76x2: fix always true condition warning reported by static checker

Message ID a7bac1a6a98a3b937fdb4bd5de4ae6337817b08d.1534759721.git.lorenzo.bianconi@redhat.com (mailing list archive)
State Rejected
Delegated to: Kalle Valo
Headers show
Series mt76x2: fix always true condition warning reported by static checker | expand

Commit Message

Lorenzo Bianconi Aug. 20, 2018, 4:50 p.m. UTC
Fix following warning reported by static checker:

drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c:35 mt76x2_tx()
warn: always true condition '(wcid->hw_key_idx != -1) => (0-255 != (-1))'

Fixes: 23405236460b ("mt76: fix transmission of encrypted mgmt frames")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
---
 drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kalle Valo Aug. 31, 2018, 3:28 p.m. UTC | #1
Lorenzo Bianconi <lorenzo.bianconi@redhat.com> wrote:

> Fix following warning reported by static checker:
> 
> drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c:35 mt76x2_tx()
> warn: always true condition '(wcid->hw_key_idx != -1) => (0-255 != (-1))'
> 
> Fixes: 23405236460b ("mt76: fix transmission of encrypted mgmt frames")
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

Dropping this as I take Geert's version

Patch set to Rejected.
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c b/drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c
index 36afb166fa3f..c0ca0df84ed8 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c
@@ -32,7 +32,7 @@  void mt76x2_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
 		msta = (struct mt76x2_sta *)control->sta->drv_priv;
 		wcid = &msta->wcid;
 		/* sw encrypted frames */
-		if (!info->control.hw_key && wcid->hw_key_idx != -1)
+		if (!info->control.hw_key && wcid->hw_key_idx != 0xff)
 			control->sta = NULL;
 	}