batman-adv: properly convert flag into a boolean value

In order to properly convert a bitwise AND to a boolean value, the whole
expression must be prepended by "!!".

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
This commit is contained in:
Antonio Quartulli 2012-08-27 09:35:54 +02:00
parent b8fcfa42e4
commit 9f9ff08d26
1 changed files with 1 additions and 1 deletions

View File

@ -2420,7 +2420,7 @@ bool batadv_tt_global_client_is_roaming(struct batadv_priv *bat_priv,
if (!tt_global_entry) if (!tt_global_entry)
goto out; 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); batadv_tt_global_entry_free_ref(tt_global_entry);
out: out:
return ret; return ret;