diff options
author | 2025-05-27 17:27:04 -0700 | |
---|---|---|
committer | 2025-05-27 20:16:57 -0700 | |
commit | c5cebb241e27ed0c3f4c1d2ce63089398e0ed17e (patch) | |
tree | dcdf1d8403eb47773170bee50ba2a616d27d54f7 /arch | |
parent | selftests/bpf: Add tests with stack ptr register in conditional jmp (diff) | |
download | wireguard-linux-c5cebb241e27ed0c3f4c1d2ce63089398e0ed17e.tar.xz wireguard-linux-c5cebb241e27ed0c3f4c1d2ce63089398e0ed17e.zip |
bpf, arm64: Remove unused-but-set function and variable.
Remove unused-but-set function and variable to fix the build warning:
arch/arm64/net/bpf_jit_comp.c: In function 'arch_bpf_trampoline_size':
2547 | int nregs, ret;
| ^~~~~
Fixes: 9014cf56f13d ("bpf, arm64: Support up to 12 function arguments")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Xu Kuohai <xukuohai@huawei.com>
Link: https://lore.kernel.org/bpf/20250528002704.21197-1-alexei.starovoitov@gmail.com
Closes: https://lore.kernel.org/oe-kbuild-all/202505280643.h0qYcSCM-lkp@intel.com/
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm64/net/bpf_jit_comp.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index b5c3ab623536..14d4c6ac4ca0 100644 --- a/arch/arm64/net/bpf_jit_comp.c +++ b/arch/arm64/net/bpf_jit_comp.c @@ -2520,21 +2520,6 @@ static int prepare_trampoline(struct jit_ctx *ctx, struct bpf_tramp_image *im, return ctx->idx; } -static int btf_func_model_nregs(const struct btf_func_model *m) -{ - int nregs = m->nr_args; - int i; - - /* extra registers needed for struct argument */ - for (i = 0; i < MAX_BPF_FUNC_ARGS; i++) { - /* The arg_size is at most 16 bytes, enforced by the verifier. */ - if (m->arg_flags[i] & BTF_FMODEL_STRUCT_ARG) - nregs += (m->arg_size[i] + 7) / 8 - 1; - } - - return nregs; -} - int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags, struct bpf_tramp_links *tlinks, void *func_addr) { @@ -2543,10 +2528,8 @@ int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags, .idx = 0, }; struct bpf_tramp_image im; - struct arg_aux aaux; - int nregs, ret; - - nregs = btf_func_model_nregs(m); + struct arg_aux aaux; + int ret; ret = calc_arg_aux(m, &aaux); if (ret < 0) |