diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2011-12-20 06:30:40 -0500 |
---|---|---|
committer | Marek Lindner <lindner_marek@yahoo.de> | 2012-02-16 13:50:20 -0500 |
commit | 032b7969f8874d5ddc65691cd3d008beffd2a09e (patch) | |
tree | 73a0e8bdd4dcf0f1dc3407b17df0424106027f9d /net/batman-adv/originator.c | |
parent | ea3d2fd1b11fb3ef8706a48ece0a49a61bcd08bc (diff) |
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 847ff7e98a61..1161f27ad8cc 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, | |||
282 | hlist_for_each_entry_safe(neigh_node, node, node_tmp, | 282 | hlist_for_each_entry_safe(neigh_node, node, node_tmp, |
283 | &orig_node->neigh_list, list) { | 283 | &orig_node->neigh_list, list) { |
284 | 284 | ||
285 | if ((time_after(jiffies, | 285 | if ((has_timed_out(neigh_node->last_valid, PURGE_TIMEOUT)) || |
286 | neigh_node->last_valid + PURGE_TIMEOUT * HZ)) || | ||
287 | (neigh_node->if_incoming->if_status == IF_INACTIVE) || | 286 | (neigh_node->if_incoming->if_status == IF_INACTIVE) || |
288 | (neigh_node->if_incoming->if_status == IF_NOT_IN_USE) || | 287 | (neigh_node->if_incoming->if_status == IF_NOT_IN_USE) || |
289 | (neigh_node->if_incoming->if_status == IF_TO_BE_REMOVED)) { | 288 | (neigh_node->if_incoming->if_status == IF_TO_BE_REMOVED)) { |
@@ -327,9 +326,7 @@ static bool purge_orig_node(struct bat_priv *bat_priv, | |||
327 | { | 326 | { |
328 | struct neigh_node *best_neigh_node; | 327 | struct neigh_node *best_neigh_node; |
329 | 328 | ||
330 | if (time_after(jiffies, | 329 | if (has_timed_out(orig_node->last_valid, 2 * PURGE_TIMEOUT)) { |
331 | orig_node->last_valid + 2 * PURGE_TIMEOUT * HZ)) { | ||
332 | |||
333 | bat_dbg(DBG_BATMAN, bat_priv, | 330 | bat_dbg(DBG_BATMAN, bat_priv, |
334 | "Originator timeout: originator %pM, last_valid %lu\n", | 331 | "Originator timeout: originator %pM, last_valid %lu\n", |
335 | orig_node->orig, (orig_node->last_valid / HZ)); | 332 | orig_node->orig, (orig_node->last_valid / HZ)); |
@@ -372,8 +369,8 @@ static void _purge_orig(struct bat_priv *bat_priv) | |||
372 | continue; | 369 | continue; |
373 | } | 370 | } |
374 | 371 | ||
375 | if (time_after(jiffies, orig_node->last_frag_packet + | 372 | if (has_timed_out(orig_node->last_frag_packet, |
376 | msecs_to_jiffies(FRAG_TIMEOUT))) | 373 | FRAG_TIMEOUT)) |
377 | frag_list_free(&orig_node->frag_list); | 374 | frag_list_free(&orig_node->frag_list); |
378 | } | 375 | } |
379 | spin_unlock_bh(list_lock); | 376 | spin_unlock_bh(list_lock); |