From: Arnd Hannemann Date: Mon, 24 Aug 2009 18:51:46 +0000 (+0200) Subject: mac80211: Fix output of minstrels rc_stats X-Git-Tag: MMI-PSA29.97-13-9~26976^2~275^2~56 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=eadac6bf95e1945bb64e6f8f22d8509391645e2e;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git mac80211: Fix output of minstrels rc_stats 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 Signed-off-by: John W. Linville --- diff --git a/net/mac80211/rc80211_minstrel_debugfs.c b/net/mac80211/rc80211_minstrel_debugfs.c index 98f480708050..3d72ec5730d4 100644 --- a/net/mac80211/rc80211_minstrel_debugfs.c +++ b/net/mac80211/rc80211_minstrel_debugfs.c @@ -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;