tools/net: Use bitwise instead of arithmetic operator for flags
authorjing yangyang <jing.yangyang@zte.com.cn>
Fri, 20 Aug 2021 03:35:27 +0000 (20:35 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Aug 2021 13:55:53 +0000 (14:55 +0100)
This silences the following coccinelle warning:

"WARNING: sum of probable bitmasks, consider |"

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: jing yangyang <jing.yangyang@zte.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/psock_fanout.c

index db45213..3653d64 100644 (file)
@@ -111,8 +111,8 @@ static int sock_fanout_open(uint16_t typeflags, uint16_t group_id)
 static void sock_fanout_set_cbpf(int fd)
 {
        struct sock_filter bpf_filter[] = {
-               BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 80),           /* ldb [80] */
-               BPF_STMT(BPF_RET+BPF_A, 0),                   /* ret A */
+               BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 80),       /* ldb [80] */
+               BPF_STMT(BPF_RET | BPF_A, 0),                 /* ret A */
        };
        struct sock_fprog bpf_prog;