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 the "!!" conversion can be removed.
This was introduced by 3fbd7ac8c71b3778c5751b3d096ea36f96ef534e ("batman-adv: substitute tt_poss_change with a per-tt_entry flag")
Signed-off-by: Antonio Quartulli ordex@autistici.org --- translation-table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/translation-table.c b/translation-table.c index cb0281a..39ae6b0 100644 --- a/translation-table.c +++ b/translation-table.c @@ -2545,7 +2545,7 @@ bool batadv_tt_local_client_is_roaming(struct batadv_priv *bat_priv, if (!tt_local_entry) goto out;
- ret = !!(tt_local_entry->common.flags & BATADV_TT_CLIENT_ROAM); + ret = tt_local_entry->common.flags & BATADV_TT_CLIENT_ROAM; batadv_tt_local_entry_free_ref(tt_local_entry); out: return ret;
On Tuesday, November 13, 2012 03:48:21 Antonio Quartulli wrote:
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 the "!!" conversion can be removed.
This was introduced by 3fbd7ac8c71b3778c5751b3d096ea36f96ef534e ("batman-adv: substitute tt_poss_change with a per-tt_entry flag")
Signed-off-by: Antonio Quartulli ordex@autistici.org
translation-table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied in revision 7f05664.
Thanks, Marek
b.a.t.m.a.n@lists.open-mesh.org