Skip to content

Commit 24820df

Browse files
committed
batman-adv: checkpatch - else is not generally useful after a break or return
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
1 parent a0e2877 commit 24820df

4 files changed

Lines changed: 5 additions & 9 deletions

File tree

‎net/batman-adv/bitarray.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ static inline int batadv_test_bit(const unsigned long *seq_bits,
2929
diff = last_seqno - curr_seqno;
3030
if (diff < 0 || diff >= BATADV_TQ_LOCAL_WINDOW_SIZE)
3131
return 0;
32-
else
33-
return test_bit(diff, seq_bits) != 0;
32+
return test_bit(diff, seq_bits) != 0;
3433
}
3534

3635
/* turn corresponding bit on, so we can remember that we got the packet */

‎net/batman-adv/fragmentation.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ batadv_frag_check_entry(struct batadv_frag_table_entry *frags_entry)
4141
if (!hlist_empty(&frags_entry->head) &&
4242
batadv_has_timed_out(frags_entry->timestamp, BATADV_FRAG_TIMEOUT))
4343
return true;
44-
else
45-
return false;
44+
return false;
4645
}
4746

4847
#endif /* _NET_BATMAN_ADV_FRAGMENTATION_H_ */

‎net/batman-adv/network-coding.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,8 +1212,7 @@ static bool batadv_nc_skb_coding_possible(struct sk_buff *skb,
12121212
{
12131213
if (BATADV_SKB_CB(skb)->decoded && !batadv_compare_eth(dst, src))
12141214
return false;
1215-
else
1216-
return true;
1215+
return true;
12171216
}
12181217

12191218
/**

‎net/batman-adv/translation-table.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2769,9 +2769,8 @@ static bool batadv_send_tt_response(struct batadv_priv *bat_priv,
27692769
{
27702770
if (batadv_is_my_mac(bat_priv, req_dst))
27712771
return batadv_send_my_tt_response(bat_priv, tt_data, req_src);
2772-
else
2773-
return batadv_send_other_tt_response(bat_priv, tt_data,
2774-
req_src, req_dst);
2772+
return batadv_send_other_tt_response(bat_priv, tt_data, req_src,
2773+
req_dst);
27752774
}
27762775

27772776
static void _batadv_tt_update_changes(struct batadv_priv *bat_priv,

0 commit comments

Comments
 (0)