[PATCH linux-next] tools/net: Use bitwise instead of arithmetic operator for flags

Subsystems: kernel selftest framework, networking [general], the rest

STALE1811d

2 messages, 2 authors, 2021-08-20 · open the first message on its own page

[PATCH linux-next] tools/net: Use bitwise instead of arithmetic operator for flags

From: CGEL <hidden>
Date: 2021-08-20 03:35:59

From: jing yangyang <redacted>

This silences the following coccinelle warning:

"WARNING: sum of probable bitmasks, consider |"

Reported-by: Zeal Robot <redacted>
Signed-off-by: jing yangyang <redacted>
---
 tools/testing/selftests/net/psock_fanout.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/net/psock_fanout.c b/tools/testing/selftests/net/psock_fanout.c
index db45213..3653d64 100644
--- a/tools/testing/selftests/net/psock_fanout.c
+++ b/tools/testing/selftests/net/psock_fanout.c
@@ -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;
 
-- 
1.8.3.1

Re: [PATCH linux-next] tools/net: Use bitwise instead of arithmetic operator for flags

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-08-20 14:00:12

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Thu, 19 Aug 2021 20:35:27 -0700 you wrote:
From: jing yangyang <redacted>

This silences the following coccinelle warning:

"WARNING: sum of probable bitmasks, consider |"

Reported-by: Zeal Robot <redacted>
Signed-off-by: jing yangyang <redacted>

[...]
Here is the summary with links:
  - [linux-next] tools/net: Use bitwise instead of arithmetic operator for flags
    https://git.kernel.org/netdev/net-next/c/fa16ee77364f

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help