diff options
author | Luis Gerhorst <luis.gerhorst@fau.de> | 2025-06-19 16:26:47 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2025-06-19 09:51:15 -0700 |
commit | e30329b8a6476eed87460e73a29ecd718ec981e1 (patch) | |
tree | 2e735c787bfd72d96392558a75c357d1e15ead7d | |
parent | cd7312a78f36e981939abe1cd1f21d355e083dfe (diff) |
powerpc/bpf: Fix warning for unused ori31_emitted
Without this, the compiler (clang21) might emit a warning under W=1
because the variable ori31_emitted is set but never used if
CONFIG_PPC_BOOK3S_64=n.
Without this patch:
$ make -j $(nproc) W=1 ARCH=powerpc SHELL=/bin/bash arch/powerpc/net
[...]
CC arch/powerpc/net/bpf_jit_comp.o
CC arch/powerpc/net/bpf_jit_comp64.o
../arch/powerpc/net/bpf_jit_comp64.c: In function 'bpf_jit_build_body':
../arch/powerpc/net/bpf_jit_comp64.c:417:28: warning: variable 'ori31_emitted' set but not used [-Wunused-but-set-variable]
417 | bool sync_emitted, ori31_emitted;
| ^~~~~~~~~~~~~
AR arch/powerpc/net/built-in.a
With this patch:
[...]
CC arch/powerpc/net/bpf_jit_comp.o
CC arch/powerpc/net/bpf_jit_comp64.o
AR arch/powerpc/net/built-in.a
Fixes: dff883d9e93a ("bpf, arm64, powerpc: Change nospec to include v1 barrier")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202506180402.uUXwVoSH-lkp@intel.com/
Signed-off-by: Luis Gerhorst <luis.gerhorst@fau.de>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20250619142647.2157017-1-luis.gerhorst@fau.de
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
-rw-r--r-- | arch/powerpc/net/bpf_jit_comp64.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c index 3665ff8bb4bc..a25a6ffe7d7c 100644 --- a/arch/powerpc/net/bpf_jit_comp64.c +++ b/arch/powerpc/net/bpf_jit_comp64.c @@ -820,13 +820,12 @@ emit_clear: case BPF_ST | BPF_NOSPEC: sync_emitted = false; ori31_emitted = false; -#ifdef CONFIG_PPC_E500 - if (!bpf_jit_bypass_spec_v1()) { + if (IS_ENABLED(CONFIG_PPC_E500) && + !bpf_jit_bypass_spec_v1()) { EMIT(PPC_RAW_ISYNC()); EMIT(PPC_RAW_SYNC()); sync_emitted = true; } -#endif if (!bpf_jit_bypass_spec_v4()) { switch (stf_barrier) { case STF_BARRIER_EIEIO: @@ -849,10 +848,10 @@ emit_clear: break; } } -#ifdef CONFIG_PPC_BOOK3S_64 - if (!bpf_jit_bypass_spec_v1() && !ori31_emitted) + if (IS_ENABLED(CONFIG_PPC_BOOK3S_64) && + !bpf_jit_bypass_spec_v1() && + !ori31_emitted) EMIT(PPC_RAW_ORI(_R31, _R31, 0)); -#endif break; /* |