batman-adv: Avoid relation operator comparison with bool
Sven Eckelmann
maintainerPATCH 1/1 batman-adv: Avoid relation operator comparison with bool
commit 34b3c3850e7d ("batman-adv: Distributed ARP Table - create DHT helper functions") introduced a return check of batadv_compare_eth which uses a boolean return value since commit 16af73458aca ("batman-adv: main, batadv_compare_eth return bool"). A relational (<, >, <= or >=) operator is not the right one for such a check.
---
Cc: David Binderman <[email protected]>
Cc: Antonio Quartulli <[email protected]>
Cc: Markus Pargmann <[email protected]>
--- net/batman-adv/distributed-arp-table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/batman-adv/distributed-arp-table.c +1 -1
@@ -493,7 +493,7 @@ static bool batadv_is_orig_node_eligible(struct batadv_dat_candidate *res,* the one with the lowest address */ if (tmp_max == max && max_orig_node && -batadv_compare_eth (candidate->orig, max_orig_node->orig) >0 ) +batadv_compare_eth (candidate->orig, max_orig_node->orig)) goto out; ret = true;
Signature · 1 line
2.11.0
Quoted 6 lines · Sven Eckelmann
commit
34b3c3850e7d("batman-adv: Distributed ARP Table - create DHT helper functions") introduced a return check ofbatadv_compare_ethwhich uses a boolean return value since commit16af73458aca("batman-adv: main,batadv_compare_ethreturn bool"). A relational (<, >, <= or >=) operator is not the right one for such a check.
Quoted 7 lines
Reported-by David Binderman <[email protected]>Signed-off-by Sven Eckelmann <[email protected]>---
Cc: David Binderman <[email protected]>
Cc: Antonio Quartulli <[email protected]>
Cc: Markus Pargmann <[email protected]>
---
Signature · 1 line
Antonio Quartulli