Commit de464375 authored by Tobias Klauser's avatar Tobias Klauser Committed by David S. Miller
Browse files

bpf: Remove unused but set variables

Remove the unused but set variables min_set and max_set in
adjust_reg_min_max_vals to fix the following warning when building with

  kernel/bpf/verifier.c:1483:7: warning: variable ‘min_set’ set but not used [-Wunused-but-set-variable]

There is no warning about max_set being unused, but since it is only
used in the assignment of min_set it can be removed as well.

They were introduced in commit 48461135

 ("bpf: allow access into map
value arrays") but seem to have never been used.

Cc: Josef Bacik <>
Signed-off-by: default avatarTobias Klauser <>
Acked-by: default avatarAlexei Starovoitov <>
Signed-off-by: default avatarDavid S. Miller <>
parent f41cd11d
......@@ -1499,7 +1499,6 @@ static void adjust_reg_min_max_vals(struct bpf_verifier_env *env,
struct bpf_reg_state *regs = env->cur_state.regs, *dst_reg;
bool min_set = false, max_set = false;
u8 opcode = BPF_OP(insn->code);
dst_reg = &regs[insn->dst_reg];
......@@ -1522,7 +1521,6 @@ static void adjust_reg_min_max_vals(struct bpf_verifier_env *env,
} else if (insn->imm < BPF_REGISTER_MAX_RANGE &&
(s64)insn->imm > BPF_REGISTER_MIN_RANGE) {
min_val = max_val = insn->imm;
min_set = max_set = true;
/* We don't know anything about what was done to this register, mark it
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