projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
99ee3a6
)
uwb: use time_after() when purging stale beacons
author
David Vrabel
<dv02@dv02pc01.europe.root.pri>
Wed, 15 Oct 2008 13:41:56 +0000
(14:41 +0100)
committer
David Vrabel
<dv02@dv02pc01.europe.root.pri>
Wed, 15 Oct 2008 13:41:56 +0000
(14:41 +0100)
Signed-off-by: David Vrabel <david.vrabel@csr.com>
drivers/uwb/beacon.c
patch
|
blob
|
history
diff --git
a/drivers/uwb/beacon.c
b/drivers/uwb/beacon.c
index f65a52c0afac722451f3315e02a3dc2a33abca4f..1ccf9eb3e08694256ed8079232de27939eaa1511 100644
(file)
--- 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_m
s)) {
+ expires = bce->ts_jiffies + msecs_to_jiffies(beacon_timeout_ms);
+
if (time_after(jiffies, expire
s)) {
uwbd_dev_offair(bce);
list_del(&bce->node);
uwb_bce_put(bce);