Skip to content

Commit c5cebb2

Browse files
Alexei Starovoitovanakryiko
Alexei Starovoitov
authored andcommitted
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: 9014cf5 ("bpf, arm64: Support up to 12 function arguments") Reported-by: kernel test robot <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Acked-by: Xu Kuohai <[email protected]> Link: https://lore.kernel.org/bpf/[email protected] Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
1 parent 5ffb537 commit c5cebb2

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

arch/arm64/net/bpf_jit_comp.c

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2520,21 +2520,6 @@ static int prepare_trampoline(struct jit_ctx *ctx, struct bpf_tramp_image *im,
25202520
return ctx->idx;
25212521
}
25222522

2523-
static int btf_func_model_nregs(const struct btf_func_model *m)
2524-
{
2525-
int nregs = m->nr_args;
2526-
int i;
2527-
2528-
/* extra registers needed for struct argument */
2529-
for (i = 0; i < MAX_BPF_FUNC_ARGS; i++) {
2530-
/* The arg_size is at most 16 bytes, enforced by the verifier. */
2531-
if (m->arg_flags[i] & BTF_FMODEL_STRUCT_ARG)
2532-
nregs += (m->arg_size[i] + 7) / 8 - 1;
2533-
}
2534-
2535-
return nregs;
2536-
}
2537-
25382523
int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,
25392524
struct bpf_tramp_links *tlinks, void *func_addr)
25402525
{
@@ -2543,10 +2528,8 @@ int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,
25432528
.idx = 0,
25442529
};
25452530
struct bpf_tramp_image im;
2546-
struct arg_aux aaux;
2547-
int nregs, ret;
2548-
2549-
nregs = btf_func_model_nregs(m);
2531+
struct arg_aux aaux;
2532+
int ret;
25502533

25512534
ret = calc_arg_aux(m, &aaux);
25522535
if (ret < 0)

0 commit comments

Comments
 (0)