Skip to content

Commit

Permalink
batman-adv: properly convert flag into a boolean value
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Antonio Quartulli committed Oct 29, 2012
1 parent b8fcfa4 commit 9f9ff08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/batman-adv/translation-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -2420,7 +2420,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;
Expand Down

0 comments on commit 9f9ff08

Please sign in to comment.