batman-adv: Use bitwise instead of arithmetic operator for flags

Message ID 1468228596-18690-1-git-send-email-linus.luessing@c0d3.blue (mailing list archive)
State Accepted, archived
Commit f0935abffeb94247020f2b7314f3fd9f769ad048
Delegated to: Marek Lindner
Headers

Commit Message

Linus Lüssing July 11, 2016, 9:16 a.m. UTC
  This silences the following coccinelle warning:

"WARNING: sum of probable bitmasks, consider |"

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
---
 net/batman-adv/multicast.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Sven Eckelmann July 11, 2016, 9:38 a.m. UTC | #1
On Montag, 11. Juli 2016 11:16:36 CEST Linus Lüssing wrote:
> This silences the following coccinelle warning:
> 
> "WARNING: sum of probable bitmasks, consider |"
> 
> Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
> ---
>  net/batman-adv/multicast.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Sven Eckelmann <sven@narfation.org>

Kind regards,
	Sven
  
Marek Lindner July 15, 2016, 7:54 a.m. UTC | #2
On Monday, July 11, 2016 11:38:19 Sven Eckelmann wrote:
> On Montag, 11. Juli 2016 11:16:36 CEST Linus Lüssing wrote:
> > This silences the following coccinelle warning:
> > 
> > "WARNING: sum of probable bitmasks, consider |"
> > 
> > Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
> > ---
> > 
> >  net/batman-adv/multicast.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Reviewed-by: Sven Eckelmann <sven@narfation.org>

Applied in revision f0935ab.

Thanks,
Marek
  

Patch

diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
index cc91507..894df60 100644
--- a/net/batman-adv/multicast.c
+++ b/net/batman-adv/multicast.c
@@ -528,7 +528,7 @@  update:
 	}
 
 	return !(mcast_data.flags &
-		 (BATADV_MCAST_WANT_ALL_IPV4 + BATADV_MCAST_WANT_ALL_IPV6));
+		 (BATADV_MCAST_WANT_ALL_IPV4 | BATADV_MCAST_WANT_ALL_IPV6));
 }
 
 /**