diff options
author | S.Çağlar Onur <caglar@pardus.org.tr> | 2008-02-14 10:36:47 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-02-29 15:37:10 -0500 |
commit | ab46623ec1f4ea022b861333ce959f0b8f9eb70e (patch) | |
tree | a23b54ed3379ab103e3c2e37bdba8d152a9c6380 /net/mac80211/rc80211_simple.c | |
parent | ac2bf3242e1a329543be50b5c9df4f0119ee188c (diff) |
net/mac80211/: Use time_* macros
The functions time_before, time_before_eq, time_after, and time_after_eq are more robust for comparing jiffies against other values.
So following patch implements usage of the time_after() macro, defined at linux/jiffies.h, which deals with wrapping correctly
Cc: linux-wireless@vger.kernel.org
Signed-off-by: S.Çağlar Onur <caglar@pardus.org.tr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/rc80211_simple.c')
-rw-r--r-- | net/mac80211/rc80211_simple.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/mac80211/rc80211_simple.c b/net/mac80211/rc80211_simple.c index c4678905a142..a669bcb8739f 100644 --- a/net/mac80211/rc80211_simple.c +++ b/net/mac80211/rc80211_simple.c | |||
@@ -7,6 +7,7 @@ | |||
7 | * published by the Free Software Foundation. | 7 | * published by the Free Software Foundation. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <linux/jiffies.h> | ||
10 | #include <linux/init.h> | 11 | #include <linux/init.h> |
11 | #include <linux/netdevice.h> | 12 | #include <linux/netdevice.h> |
12 | #include <linux/types.h> | 13 | #include <linux/types.h> |
@@ -175,7 +176,7 @@ static void rate_control_simple_tx_status(void *priv, struct net_device *dev, | |||
175 | rate_control_rate_dec(local, sta); | 176 | rate_control_rate_dec(local, sta); |
176 | } | 177 | } |
177 | 178 | ||
178 | if (srctrl->avg_rate_update + 60 * HZ < jiffies) { | 179 | if (time_after(jiffies, srctrl->avg_rate_update + 60 * HZ)) { |
179 | srctrl->avg_rate_update = jiffies; | 180 | srctrl->avg_rate_update = jiffies; |
180 | if (srctrl->tx_avg_rate_num > 0) { | 181 | if (srctrl->tx_avg_rate_num > 0) { |
181 | #ifdef CONFIG_MAC80211_VERBOSE_DEBUG | 182 | #ifdef CONFIG_MAC80211_VERBOSE_DEBUG |