You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/04/16 17:47:04 UTC

[incubator-nuttx] 01/04: netlink: Fix the compiler warning in netlink_add_broadcast

This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch pr807
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 0c630d79f9d3e2630983ff40c0da98c7d7fef9a4
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Thu Apr 16 13:50:20 2020 +0800

    netlink: Fix the compiler warning in netlink_add_broadcast
    
    netlink/netlink_conn.c: In function 'netlink_add_broadcast':
    netlink/netlink_conn.c:319:45: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
      319 |       if (conn->groups & (1 << (group - 1)) == 0)
          |                          ~~~~~~~~~~~~~~~~~~~^~~~
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
    Change-Id: I1bee7933dca1bdd118d0034a564b4306e1ae5684
---
 net/netlink/netlink_conn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netlink/netlink_conn.c b/net/netlink/netlink_conn.c
index 9145ef2..96aed71 100644
--- a/net/netlink/netlink_conn.c
+++ b/net/netlink/netlink_conn.c
@@ -317,7 +317,7 @@ void netlink_add_broadcast(int group, FAR struct netlink_response_s *data)
 
   while ((conn = netlink_nextconn(conn)) != NULL)
     {
-      if (conn->groups & (1 << (group - 1)) == 0)
+      if ((conn->groups & (1 << (group - 1))) == 0)
         {
           continue;
         }