mac80211: Fix output of minstrels rc_stats
authorArnd Hannemann <hannemann@nets.rwth-aachen.de>
Mon, 24 Aug 2009 18:51:46 +0000 (20:51 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 28 Aug 2009 18:40:43 +0000 (14:40 -0400)
An integer overflow in the minstrel debug code prevented the
throughput to be displayed correctly. This patch fixes that,
by permutating operations like proposed by Pavel Roskin.

Signed-off-by: Arnd Hannemann <hannemann@nets.rwth-aachen.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/rc80211_minstrel_debugfs.c

index 98f4807080508b183d35b64e82558cce321f3f88..3d72ec5730d4482a183b9844d23be10e314f2cd0 100644 (file)
@@ -83,7 +83,7 @@ minstrel_stats_open(struct inode *inode, struct file *file)
                p += sprintf(p, "%3u%s", mr->bitrate / 2,
                                (mr->bitrate & 1 ? ".5" : "  "));
 
-               tp = ((mr->cur_tp * 96) / 18000) >> 10;
+               tp = mr->cur_tp / ((18000 << 10) / 96);
                prob = mr->cur_prob / 18;
                eprob = mr->probability / 18;