aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorS.Çağlar Onur <caglar@pardus.org.tr>2008-02-14 17:36:49 +0200
committerJohn W. Linville <linville@tuxdriver.com>2008-02-29 15:37:11 -0500
commit6e33e30d7ae11d527ad1d65ec09a65467d6db1b2 (patch)
tree7ad771b14dff42468c7ddba190a3556c437b7668
parentab46623ec1f4ea022b861333ce959f0b8f9eb70e (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>
-rw-r--r--drivers/net/wireless/atmel.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c
index 63ec7a70ee7..ef2da4023d6 100644
--- a/drivers/net/wireless/atmel.c
+++ b/drivers/net/wireless/atmel.c
@@ -66,6 +66,7 @@
#include <linux/device.h>
#include <linux/moduleparam.h>
#include <linux/firmware.h>
+#include <linux/jiffies.h>
#include <net/ieee80211.h>
#include "atmel.h"
@@ -516,7 +517,7 @@ struct atmel_private {
SITE_SURVEY_IN_PROGRESS,
SITE_SURVEY_COMPLETED
} site_survey_state;
- time_t last_survey;
+ unsigned long last_survey;
int station_was_associated, station_is_associated;
int fast_scan;
@@ -2283,7 +2284,7 @@ static int atmel_set_scan(struct net_device *dev,
return -EAGAIN;
/* Timeout old surveys. */
- if ((jiffies - priv->last_survey) > (20 * HZ))
+ if (time_after(jiffies, priv->last_survey + 20 * HZ))
priv->site_survey_state = SITE_SURVEY_IDLE;
priv->last_survey = jiffies;