Commit 0217eefa64509d63fbe8d1205310bafb2355cf4d

Authored by Felix Fietkau
Committed by Johannes Berg
1 parent 1109dc392e

mac80211: minstrel: reduce MINSTREL_SCALE

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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

net/mac80211/rc80211_minstrel.h
... ... @@ -14,7 +14,7 @@
14 14 #define SAMPLE_COLUMNS 10 /* number of columns in sample table */
15 15  
16 16 /* scaled fraction values */
17   -#define MINSTREL_SCALE 16
  17 +#define MINSTREL_SCALE 12
18 18 #define MINSTREL_FRAC(val, div) (((val) << MINSTREL_SCALE) / div)
19 19 #define MINSTREL_TRUNC(val) ((val) >> MINSTREL_SCALE)
20 20