diff options
author | David Vrabel <dv02@dv02pc01.europe.root.pri> | 2008-10-15 09:41:56 -0400 |
---|---|---|
committer | David Vrabel <dv02@dv02pc01.europe.root.pri> | 2008-10-15 09:41:56 -0400 |
commit | 45c16cd9287819cf1c870f2d8e7738c4c90512ca (patch) | |
tree | e7fcd3c398338970692c3df596d557d6c7e21869 /drivers/uwb/beacon.c | |
parent | 99ee3a6d4577e7633c66304e4aefeca5489c8d5c (diff) |
uwb: use time_after() when purging stale beacons
Signed-off-by: David Vrabel <david.vrabel@csr.com>
Diffstat (limited to 'drivers/uwb/beacon.c')
-rw-r--r-- | drivers/uwb/beacon.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/uwb/beacon.c b/drivers/uwb/beacon.c index f65a52c0afac..1ccf9eb3e086 100644 --- a/drivers/uwb/beacon.c +++ b/drivers/uwb/beacon.c | |||
@@ -298,11 +298,12 @@ struct uwb_beca_e *__uwb_beca_add(struct uwb_rc_evt_beacon *be, | |||
298 | void uwb_beca_purge(void) | 298 | void uwb_beca_purge(void) |
299 | { | 299 | { |
300 | struct uwb_beca_e *bce, *next; | 300 | struct uwb_beca_e *bce, *next; |
301 | unsigned long now = jiffies; | 301 | unsigned long expires; |
302 | |||
302 | mutex_lock(&uwb_beca.mutex); | 303 | mutex_lock(&uwb_beca.mutex); |
303 | list_for_each_entry_safe(bce, next, &uwb_beca.list, node) { | 304 | list_for_each_entry_safe(bce, next, &uwb_beca.list, node) { |
304 | if (now - bce->ts_jiffies | 305 | expires = bce->ts_jiffies + msecs_to_jiffies(beacon_timeout_ms); |
305 | > msecs_to_jiffies(beacon_timeout_ms)) { | 306 | if (time_after(jiffies, expires)) { |
306 | uwbd_dev_offair(bce); | 307 | uwbd_dev_offair(bce); |
307 | list_del(&bce->node); | 308 | list_del(&bce->node); |
308 | uwb_bce_put(bce); | 309 | uwb_bce_put(bce); |