* [B.A.T.M.A.N.] [PATCH next] batman-adv: remove useless !! when converting to bool
@ 2012-11-12 19:48 Antonio Quartulli
2012-11-13 10:29 ` Marek Lindner
0 siblings, 1 reply; 2+ messages in thread
From: Antonio Quartulli @ 2012-11-12 19:48 UTC (permalink / raw)
To: b.a.t.m.a.n
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;
--
1.8.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH next] batman-adv: remove useless !! when converting to bool
2012-11-12 19:48 [B.A.T.M.A.N.] [PATCH next] batman-adv: remove useless !! when converting to bool Antonio Quartulli
@ 2012-11-13 10:29 ` Marek Lindner
0 siblings, 0 replies; 2+ messages in thread
From: Marek Lindner @ 2012-11-13 10:29 UTC (permalink / raw)
To: b.a.t.m.a.n
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-13 10:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-12 19:48 [B.A.T.M.A.N.] [PATCH next] batman-adv: remove useless !! when converting to bool Antonio Quartulli
2012-11-13 10:29 ` Marek Lindner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox