Skip to contentSkip to conversation

mt76x2: fix always true condition warning reported by static checker

PATCH In review Lorenzo Bianconi 2 participants 2 messages Aug 20, 2018 – Aug 31, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 mt76x2: fix always true condition warning reported by static checker

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")
---
 drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c +1 -1
index 36afb166fa3f..c0ca0df84ed8 100644
@@ -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;
 	}
 
Signature · 1 line
2.17.1
#2 lore raw
Quoted 7 lines · Lorenzo Bianconi

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")

Dropping this as I take Geert's version

Patch set to Rejected.

Signature · 3 lines
https://patchwork.kernel.org/patch/10570555/

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