mac80211: minstrel: reduce MINSTREL_SCALE
authorFelix Fietkau <nbd@nbd.name>
Wed, 14 Dec 2016 19:46:59 +0000 (20:46 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 15 Dec 2016 10:07:52 +0000 (11:07 +0100)
The loss of a bit of extra precision does not hurt the calculation, 12
bits is still enough to calculate probabilities well. Reducing the scale
makes it easier to avoid overflows

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/rc80211_minstrel.h

index 94b89b1..03716fd 100644 (file)
@@ -14,7 +14,7 @@
 #define SAMPLE_COLUMNS 10      /* number of columns in sample table */
 
 /* scaled fraction values */
-#define MINSTREL_SCALE  16
+#define MINSTREL_SCALE  12
 #define MINSTREL_FRAC(val, div) (((val) << MINSTREL_SCALE) / div)
 #define MINSTREL_TRUNC(val) ((val) >> MINSTREL_SCALE)