[PATCH] bpf: Simplify bool comparison

Subsystems: bpf [general] (safe dynamic programs and tools), the rest

STALE2032d LANDED

Landed in mainline as 0a1b0fd929a8 on 2021-02-09.

2 messages, 2 authors, 2021-02-09 · open the first message on its own page

[PATCH] bpf: Simplify bool comparison

From: Jiapeng Chong <hidden>
Date: 2021-02-08 09:54:48

Fix the following coccicheck warning:

./tools/bpf/bpf_dbg.c:893:32-36: WARNING: Comparison to bool.

Reported-by: Abaci Robot <redacted>
Signed-off-by: Jiapeng Chong <redacted>
---
 tools/bpf/bpf_dbg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/bpf/bpf_dbg.c b/tools/bpf/bpf_dbg.c
index a0ebcdf..a07dfc4 100644
--- a/tools/bpf/bpf_dbg.c
+++ b/tools/bpf/bpf_dbg.c
@@ -890,7 +890,7 @@ static int bpf_run_stepping(struct sock_filter *f, uint16_t bpf_len,
 	bool stop = false;
 	int i = 1;
 
-	while (bpf_curr.Rs == false && stop == false) {
+	while (!bpf_curr.Rs && !stop) {
 		bpf_safe_regs();
 
 		if (i++ == next)
-- 
1.8.3.1

Re: [PATCH] bpf: Simplify bool comparison

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-02-09 02:01:40

Hello:

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

On Mon,  8 Feb 2021 17:43:36 +0800 you wrote:
Fix the following coccicheck warning:

./tools/bpf/bpf_dbg.c:893:32-36: WARNING: Comparison to bool.

Reported-by: Abaci Robot <redacted>
Signed-off-by: Jiapeng Chong <redacted>

[...]
Here is the summary with links:
  - bpf: Simplify bool comparison
    https://git.kernel.org/bpf/bpf-next/c/0a1b0fd929a8

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