Commit 1b04aee7 authored by Jiong Wang's avatar Jiong Wang Committed by Alexei Starovoitov

bpf: refactor propagate_liveness to eliminate duplicated for loop

Propagation for register and stack slot are finished in separate for loop,
while they are perfect to be put into a single loop.

This could also let them share some common variables in later patches.
Signed-off-by: default avatarJiong Wang <jiong.wang@netronome.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 51356ac8
......@@ -6254,10 +6254,8 @@ static int propagate_liveness(struct bpf_verifier_env *env,
return err;
}
}
}
/* ... and stack slots */
for (frame = 0; frame <= vstate->curframe; frame++) {
/* Propagate stack slots. */
state = vstate->frame[frame];
parent = vparent->frame[frame];
for (i = 0; i < state->allocated_stack / BPF_REG_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