Commit aec42f36 authored by Alexei Starovoitov's avatar Alexei Starovoitov

bpf: Remove unused variables.

Remove unused prev_offset, min_size, krec_size variables.
Reported-by: default avatarkernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202309190634.fL17FWoT-lkp@intel.com/
Fixes: aaa619eb ("bpf: Refactor check_btf_func and split into two phases")
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 5bfdb4fb
...@@ -15339,14 +15339,12 @@ static int check_btf_func(struct bpf_verifier_env *env, ...@@ -15339,14 +15339,12 @@ static int check_btf_func(struct bpf_verifier_env *env,
bpfptr_t uattr) bpfptr_t uattr)
{ {
const struct btf_type *type, *func_proto, *ret_type; const struct btf_type *type, *func_proto, *ret_type;
u32 i, nfuncs, urec_size, min_size; u32 i, nfuncs, urec_size;
u32 krec_size = sizeof(struct bpf_func_info);
struct bpf_func_info *krecord; struct bpf_func_info *krecord;
struct bpf_func_info_aux *info_aux = NULL; struct bpf_func_info_aux *info_aux = NULL;
struct bpf_prog *prog; struct bpf_prog *prog;
const struct btf *btf; const struct btf *btf;
bpfptr_t urecord; bpfptr_t urecord;
u32 prev_offset = 0;
bool scalar_return; bool scalar_return;
int ret = -ENOMEM; int ret = -ENOMEM;
...@@ -15367,7 +15365,6 @@ static int check_btf_func(struct bpf_verifier_env *env, ...@@ -15367,7 +15365,6 @@ static int check_btf_func(struct bpf_verifier_env *env,
btf = prog->aux->btf; btf = prog->aux->btf;
urecord = make_bpfptr(attr->func_info, uattr.is_kernel); urecord = make_bpfptr(attr->func_info, uattr.is_kernel);
min_size = min_t(u32, krec_size, urec_size);
krecord = prog->aux->func_info; krecord = prog->aux->func_info;
info_aux = kcalloc(nfuncs, sizeof(*info_aux), GFP_KERNEL | __GFP_NOWARN); info_aux = kcalloc(nfuncs, sizeof(*info_aux), GFP_KERNEL | __GFP_NOWARN);
...@@ -15401,7 +15398,6 @@ static int check_btf_func(struct bpf_verifier_env *env, ...@@ -15401,7 +15398,6 @@ static int check_btf_func(struct bpf_verifier_env *env,
goto err_free; goto err_free;
} }
prev_offset = krecord[i].insn_off;
bpfptr_add(&urecord, urec_size); bpfptr_add(&urecord, urec_size);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment