summaryrefslogtreecommitdiffstats
path: root/kernel/bpf
diff options
context:
space:
mode:
authorJiong Wang <jiong.wang@netronome.com>2019-04-12 22:59:34 +0100
committerAlexei Starovoitov <ast@kernel.org>2019-04-12 17:06:33 -0700
commit1b04aee7e2182454a663950e68084fa5ada9625a (patch)
tree9c30613481104cd29ffb83d63eafe080914a63ca /kernel/bpf
parent51356ac89b5a15e5207e8740d5f4f8b71cb7332f (diff)
downloadlinux-1b04aee7e2182454a663950e68084fa5ada9625a.tar.bz2
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: Jiong Wang <jiong.wang@netronome.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel/bpf')
-rw-r--r--kernel/bpf/verifier.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 15ab6fa817ce..da285df492fd 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -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 &&