Skip to contentSkip to conversation

bpf: Silence unused-but-set-variable warning in bpf_for_each_reg_in_vstate_mask

PATCH Applied Amery Hung 2 participants 2 messages Jun 2

Subsystems (4)
lore
Share & tools
lore

Amery Hung

author
#0 lore raw

PATCH 1/1 bpf: Silence unused-but-set-variable warning in bpf_for_each_reg_in_vstate_mask

The macro requires callers to pass a stack variable, but not all callbacks use it. Add (void)__stack to suppress the clang W=1 warning.

---
 include/linux/bpf_verifier.h | 1 +
 1 file changed, 1 insertion(+)
include/linux/bpf_verifier.h +1 -0
index 3dd2d21230af..c248ff41f42a 100644
@@ -582,6 +582,7 @@ bpf_get_spilled_stack_arg(int slot, struct bpf_func_state *frame)
 				(void)(__expr);                          \
 			}						 \
 		}                                                        \
+		(void)__stack;                                           \
 	})
 
 /* Invoke __expr over regsiters in __vst, setting __state and __reg */
Signature · 1 line
2.53.0-Meta
#1 lore raw
This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:

Quoted 7 lines · On Tue, 2 Jun 2026 10:52:04 -0700 you wrote:

The macro requires callers to pass a stack variable, but not all callbacks use it. Add (void)__stack to suppress the clang W=1 warning.

---
 include/linux/bpf_verifier.h | 1 +
 1 file changed, 1 insertion(+)

Here is the summary with links:
- [bpf-next,1/1] bpf: Silence unused-but-set-variable warning in bpf_for_each_reg_in_vstate_mask

    https://git.kernel.org/bpf/bpf-next/c/c169a2a5fd9c

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html