diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2012-03-17 08:28:33 +0100 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-05-13 19:06:40 +0200 |
commit | 8c7bf248a318444accbe0c2c5db15bd727661606 (patch) | |
tree | 778d9884d61e32e260e888614fff9aab0019e846 /net | |
parent | batman-adv: prepare lq_update_lock to be shared among different protocols (diff) | |
download | linux-8c7bf248a318444accbe0c2c5db15bd727661606.tar.xz linux-8c7bf248a318444accbe0c2c5db15bd727661606.zip |
batman-adv: refactor window_protected to avoid unnecessary return statement
Reported-by: David Laight <David.Laight@aculab.com>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to '')
-rw-r--r-- | net/batman-adv/routing.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index b1824bba09b3..840e2c64a301 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@ -234,17 +234,14 @@ int window_protected(struct bat_priv *bat_priv, int32_t seq_num_diff, { if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE) || (seq_num_diff >= EXPECTED_SEQNO_RANGE)) { - if (has_timed_out(*last_reset, RESET_PROTECTION_MS)) { - - *last_reset = jiffies; - bat_dbg(DBG_BATMAN, bat_priv, - "old packet received, start protection\n"); - - return 0; - } else { + if (!has_timed_out(*last_reset, RESET_PROTECTION_MS)) return 1; - } + + *last_reset = jiffies; + bat_dbg(DBG_BATMAN, bat_priv, + "old packet received, start protection\n"); } + return 0; } |