Skip to contentSkip to conversation

cfg80211: add warning when calculating MCS rates >= 32

PATCH New Johannes Berg 1 participant 1 message May 8, 2012 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 cfg80211: add warning when calculating MCS rates >= 32

From: Johannes Berg <[email protected]>

cfg80211_calculate_bitrate() doesn't work for MCS
rates 32 or higher, and it has always returned 0
in that case. Warn if it ever really happens.

---
 net/wireless/util.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/wireless/util.c +1 -1
@@ -879,7 +879,7 @@ u16 cfg80211_calculate_bitrate(struct ra
 		return rate->legacy;
 
 	/* the formula below does only work for MCS values smaller than 32 */
-	if (rate->mcs >= 32)
+	if (WARN_ON_ONCE(rate->mcs >= 32))
 		return 0;
 
 	modulation = rate->mcs & 7;