Skip to contentSkip to conversation

bpf: Simplify bool comparison

PATCH Applied Jiapeng Chong 2 participants 2 messages Feb 8, 2021 – Feb 9, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpf: Simplify bool comparison

Fix the following coccicheck warning:

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

---
 tools/bpf/bpf_dbg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bpf/bpf_dbg.c +1 -1
index a0ebcdf..a07dfc4 100644
@@ -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)
Signature · 1 line
1.8.3.1
#1 lore raw
This patch was applied to bpf/bpf-next.git (refs/heads/master):

Hello:

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

Quoted 8 lines · 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.

[...]

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