diff options
author | Simon Wunderlich <siwu@hrz.tu-chemnitz.de> | 2010-06-26 00:28:20 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-07-08 12:17:32 -0700 |
commit | b6be4535e3e971181e19791e12c62f4938e6d2e9 (patch) | |
tree | ac5bb305d63c120b5e7db33e8dd0e7fbe18ce0a4 /drivers/staging/batman-adv/originator.c | |
parent | b26b45845b29d83e7537dcd16827a478f6cee346 (diff) | |
download | op-kernel-dev-b6be4535e3e971181e19791e12c62f4938e6d2e9.zip op-kernel-dev-b6be4535e3e971181e19791e12c62f4938e6d2e9.tar.gz |
Staging: batman-adv: Lower resolution for timeouts
It is enough for our timeouts to keep them in seconds instead of miliseconds.
With a too high resolution, we might even risk an integer overflow, so this
patch should make things more safe.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/batman-adv/originator.c')
-rw-r--r-- | drivers/staging/batman-adv/originator.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/batman-adv/originator.c b/drivers/staging/batman-adv/originator.c index 195c1ee..26bbf2d 100644 --- a/drivers/staging/batman-adv/originator.c +++ b/drivers/staging/batman-adv/originator.c @@ -193,8 +193,7 @@ static bool purge_orig_neighbors(struct orig_node *orig_node, neigh_node = list_entry(list_pos, struct neigh_node, list); if ((time_after(jiffies, - (neigh_node->last_valid + - ((PURGE_TIMEOUT * HZ) / 1000)))) || + neigh_node->last_valid + PURGE_TIMEOUT * HZ)) || (neigh_node->if_incoming->if_status == IF_TO_BE_REMOVED)) { @@ -231,8 +230,7 @@ static bool purge_orig_node(struct orig_node *orig_node) struct neigh_node *best_neigh_node; if (time_after(jiffies, - (orig_node->last_valid + - ((2 * PURGE_TIMEOUT * HZ) / 1000)))) { + orig_node->last_valid + 2 * PURGE_TIMEOUT * HZ)) { bat_dbg(DBG_BATMAN, "Originator timeout: originator %pM, last_valid %lu\n", |