diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2011-12-20 19:30:40 +0800 |
---|---|---|
committer | Marek Lindner <lindner_marek@yahoo.de> | 2012-02-17 02:50:20 +0800 |
commit | 032b7969f8874d5ddc65691cd3d008beffd2a09e (patch) | |
tree | 73a0e8bdd4dcf0f1dc3407b17df0424106027f9d /net/batman-adv/originator.c | |
parent | ea3d2fd1b11fb3ef8706a48ece0a49a61bcd08bc (diff) | |
download | op-kernel-dev-032b7969f8874d5ddc65691cd3d008beffd2a09e.zip op-kernel-dev-032b7969f8874d5ddc65691cd3d008beffd2a09e.tar.gz |
batman-adv: convert time_after instances to has_timed_out
To increase readability the has_timed_out() functions has been introduced.
This patch converts existing time_after() calls to use this wrapper
function (if applicable).
This patch also converts all timeouts to miliseconds to be consistent.
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Diffstat (limited to 'net/batman-adv/originator.c')
-rw-r--r-- | net/batman-adv/originator.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c index 847ff7e..1161f27 100644 --- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c @@ -282,8 +282,7 @@ static bool purge_orig_neighbors(struct bat_priv *bat_priv, hlist_for_each_entry_safe(neigh_node, node, node_tmp, &orig_node->neigh_list, list) { - if ((time_after(jiffies, - neigh_node->last_valid + PURGE_TIMEOUT * HZ)) || + if ((has_timed_out(neigh_node->last_valid, PURGE_TIMEOUT)) || (neigh_node->if_incoming->if_status == IF_INACTIVE) || (neigh_node->if_incoming->if_status == IF_NOT_IN_USE) || (neigh_node->if_incoming->if_status == IF_TO_BE_REMOVED)) { @@ -327,9 +326,7 @@ static bool purge_orig_node(struct bat_priv *bat_priv, { struct neigh_node *best_neigh_node; - if (time_after(jiffies, - orig_node->last_valid + 2 * PURGE_TIMEOUT * HZ)) { - + if (has_timed_out(orig_node->last_valid, 2 * PURGE_TIMEOUT)) { bat_dbg(DBG_BATMAN, bat_priv, "Originator timeout: originator %pM, last_valid %lu\n", orig_node->orig, (orig_node->last_valid / HZ)); @@ -372,8 +369,8 @@ static void _purge_orig(struct bat_priv *bat_priv) continue; } - if (time_after(jiffies, orig_node->last_frag_packet + - msecs_to_jiffies(FRAG_TIMEOUT))) + if (has_timed_out(orig_node->last_frag_packet, + FRAG_TIMEOUT)) frag_list_free(&orig_node->frag_list); } spin_unlock_bh(list_lock); |