diff options
author | David Vrabel <dv02@dv02pc01.europe.root.pri> | 2008-10-15 15:41:56 +0200 |
---|---|---|
committer | David Vrabel <dv02@dv02pc01.europe.root.pri> | 2008-10-15 15:41:56 +0200 |
commit | 45c16cd9287819cf1c870f2d8e7738c4c90512ca (patch) | |
tree | e7fcd3c398338970692c3df596d557d6c7e21869 /drivers/uwb | |
parent | Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/... (diff) | |
download | linux-45c16cd9287819cf1c870f2d8e7738c4c90512ca.tar.xz linux-45c16cd9287819cf1c870f2d8e7738c4c90512ca.zip |
uwb: use time_after() when purging stale beacons
Signed-off-by: David Vrabel <david.vrabel@csr.com>
Diffstat (limited to 'drivers/uwb')
-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, void uwb_beca_purge(void) { struct uwb_beca_e *bce, *next; - unsigned long now = jiffies; + unsigned long expires; + mutex_lock(&uwb_beca.mutex); list_for_each_entry_safe(bce, next, &uwb_beca.list, node) { - if (now - bce->ts_jiffies - > msecs_to_jiffies(beacon_timeout_ms)) { + expires = bce->ts_jiffies + msecs_to_jiffies(beacon_timeout_ms); + if (time_after(jiffies, expires)) { uwbd_dev_offair(bce); list_del(&bce->node); uwb_bce_put(bce); |