Skip to contentSkip to conversation

wifi: mt76: mt7925: Remove useless condition

PATCH New Ethan Tidmore 1 participant 1 message Aug 18

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: mt76: mt7925: Remove useless condition

The condition (master_pref > NAN_MAX_MASTER_PREFERENCE) will always be false because the variable 'master_pref' is of type u8 and the macro 'NAN_MAX_MASTER_PREFERENCE' is equal to 255.

Fixes a5487a6824068 ("wifi: mt76: mt7925: add NAN MCU helpers")
---
 drivers/net/wireless/mediatek/mt76/mt7925/nan.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7925/nan.c +0 -3
index d260e803d056..8d13a42b72a8 100644
@@ -255,9 +255,6 @@ mt7925_nan_mp_tlv(struct sk_buff *skb, u8 master_pref)
 
 	mp_tlv = (struct mt7925_nan_master_preference_tlv *)tlv;
 
-	if (master_pref > NAN_MAX_MASTER_PREFERENCE)
-		return 0;
-
 	mp_tlv->master_preference = master_pref;
 
 	return 0;
Signature · 3 lines
Thanks,
ET
https://github.com/sponsors/ethantidmore