batman-adv: don't use !! in bool conversion
In C standard any expression different from 0 will be converted to 'true' when casting to bool (whatever is the length of the value). Therefore all the "!!" conversions can be removed. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
This commit is contained in:
@@ -902,7 +902,7 @@ out_remove:
|
||||
/* remove address from local hash if present */
|
||||
local_flags = batadv_tt_local_remove(bat_priv, tt_addr,
|
||||
"global tt received",
|
||||
!!(flags & BATADV_TT_CLIENT_ROAM));
|
||||
flags & BATADV_TT_CLIENT_ROAM);
|
||||
tt_global_entry->common.flags |= local_flags & BATADV_TT_CLIENT_WIFI;
|
||||
|
||||
if (!(flags & BATADV_TT_CLIENT_ROAM))
|
||||
@@ -2515,7 +2515,7 @@ bool batadv_tt_global_client_is_roaming(struct batadv_priv *bat_priv,
|
||||
if (!tt_global_entry)
|
||||
goto out;
|
||||
|
||||
ret = !!(tt_global_entry->common.flags & BATADV_TT_CLIENT_ROAM);
|
||||
ret = tt_global_entry->common.flags & BATADV_TT_CLIENT_ROAM;
|
||||
batadv_tt_global_entry_free_ref(tt_global_entry);
|
||||
out:
|
||||
return ret;
|
||||
|
Reference in New Issue
Block a user