]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bpf: Silence unused-but-set-variable warning in bpf_for_each_reg_in_vstate_mask
authorAmery Hung <ameryhung@gmail.com>
Tue, 2 Jun 2026 17:52:04 +0000 (10:52 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 2 Jun 2026 19:02:08 +0000 (12:02 -0700)
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.

Signed-off-by: Amery Hung <ameryhung@gmail.com>
Link: https://lore.kernel.org/r/20260602175204.624401-1-ameryhung@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/bpf_verifier.h

index 3dd2d21230afd1832408b599fde9724fc273a94d..c248ff41f42ace44f731e96550c8681f42c1be56 100644 (file)
@@ -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 */