mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-12 00:38:55 +00:00
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>
This commit is contained in:
parent
e3b0d0dea6
commit
8c7bf248a3
@ -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) ||
|
if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE) ||
|
||||||
(seq_num_diff >= EXPECTED_SEQNO_RANGE)) {
|
(seq_num_diff >= EXPECTED_SEQNO_RANGE)) {
|
||||||
if (has_timed_out(*last_reset, RESET_PROTECTION_MS)) {
|
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 {
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
|
||||||
|
*last_reset = jiffies;
|
||||||
|
bat_dbg(DBG_BATMAN, bat_priv,
|
||||||
|
"old packet received, start protection\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user