aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/mac80211/rc80211_minstrel.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/mac80211/rc80211_minstrel.h b/net/mac80211/rc80211_minstrel.h
index 0083036161af..9c85a610b57b 100644
--- a/net/mac80211/rc80211_minstrel.h
+++ b/net/mac80211/rc80211_minstrel.h
@@ -27,7 +27,12 @@
27static inline int 27static inline int
28minstrel_ewma(int old, int new, int weight) 28minstrel_ewma(int old, int new, int weight)
29{ 29{
30 return (new * (EWMA_DIV - weight) + old * weight) / EWMA_DIV; 30 int diff, incr;
31
32 diff = new - old;
33 incr = (EWMA_DIV - weight) * diff / EWMA_DIV;
34
35 return old + incr;
31} 36}
32 37
33struct minstrel_rate_stats { 38struct minstrel_rate_stats {