diff options
author | S.Çağlar Onur <caglar@pardus.org.tr> | 2008-02-14 10:36:49 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-02-29 15:37:11 -0500 |
commit | 6e33e30d7ae11d527ad1d65ec09a65467d6db1b2 (patch) | |
tree | 7ad771b14dff42468c7ddba190a3556c437b7668 /drivers/net/wireless/atmel.c | |
parent | ab46623ec1f4ea022b861333ce959f0b8f9eb70e (diff) |
drivers/net/wireless/atmel.c: 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 'drivers/net/wireless/atmel.c')
-rw-r--r-- | drivers/net/wireless/atmel.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c index 63ec7a70ee76..ef2da4023d68 100644 --- a/drivers/net/wireless/atmel.c +++ b/drivers/net/wireless/atmel.c | |||
@@ -66,6 +66,7 @@ | |||
66 | #include <linux/device.h> | 66 | #include <linux/device.h> |
67 | #include <linux/moduleparam.h> | 67 | #include <linux/moduleparam.h> |
68 | #include <linux/firmware.h> | 68 | #include <linux/firmware.h> |
69 | #include <linux/jiffies.h> | ||
69 | #include <net/ieee80211.h> | 70 | #include <net/ieee80211.h> |
70 | #include "atmel.h" | 71 | #include "atmel.h" |
71 | 72 | ||
@@ -516,7 +517,7 @@ struct atmel_private { | |||
516 | SITE_SURVEY_IN_PROGRESS, | 517 | SITE_SURVEY_IN_PROGRESS, |
517 | SITE_SURVEY_COMPLETED | 518 | SITE_SURVEY_COMPLETED |
518 | } site_survey_state; | 519 | } site_survey_state; |
519 | time_t last_survey; | 520 | unsigned long last_survey; |
520 | 521 | ||
521 | int station_was_associated, station_is_associated; | 522 | int station_was_associated, station_is_associated; |
522 | int fast_scan; | 523 | int fast_scan; |
@@ -2283,7 +2284,7 @@ static int atmel_set_scan(struct net_device *dev, | |||
2283 | return -EAGAIN; | 2284 | return -EAGAIN; |
2284 | 2285 | ||
2285 | /* Timeout old surveys. */ | 2286 | /* Timeout old surveys. */ |
2286 | if ((jiffies - priv->last_survey) > (20 * HZ)) | 2287 | if (time_after(jiffies, priv->last_survey + 20 * HZ)) |
2287 | priv->site_survey_state = SITE_SURVEY_IDLE; | 2288 | priv->site_survey_state = SITE_SURVEY_IDLE; |
2288 | priv->last_survey = jiffies; | 2289 | priv->last_survey = jiffies; |
2289 | 2290 | ||