提交 17dce158 编写于 作者: J Jiri Slaby 提交者: Johannes Berg

mac80211/minstrel: fix !x!=0 confusion

Commit 06d961a8 ("mac80211/minstrel: use the new rate control API")
inverted the condition 'if (msr->sample_limit != 0)' to
'if (!msr->sample_limit != 0)'. But it is confusing both to people and
compilers (gcc5):
net/mac80211/rc80211_minstrel.c: In function 'minstrel_get_rate':
net/mac80211/rc80211_minstrel.c:376:26: warning: logical not is only applied to the left hand side of comparison
   if (!msr->sample_limit != 0)
                          ^

Let there be only 'if (!msr->sample_limit)'.

Fixes: 06d961a8 ("mac80211/minstrel: use the new rate control API")
Signed-off-by: NJiri Slaby <jslaby@suse.cz>
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 81daf735
...@@ -373,7 +373,7 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta, ...@@ -373,7 +373,7 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta,
rate++; rate++;
mi->sample_deferred++; mi->sample_deferred++;
} else { } else {
if (!msr->sample_limit != 0) if (!msr->sample_limit)
return; return;
mi->sample_packets++; mi->sample_packets++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册