summaryrefslogtreecommitdiffstats
path: root/kernel/scs.c
diff options
context:
space:
mode:
authorLorenz Bauer <lmb@cloudflare.com>2020-09-21 13:12:26 +0100
committerAlexei Starovoitov <ast@kernel.org>2020-09-21 15:00:41 -0700
commitfd1b0d604c56e0d9f143b39a92132a2ea9625e6d (patch)
tree1e267745789439496f30a151536d621e1151389a /kernel/scs.c
parentc18f0b6aee2aaa6ab2aefd4b9aa1d89142a48824 (diff)
downloadlinux-fd1b0d604c56e0d9f143b39a92132a2ea9625e6d.tar.bz2
bpf: Hoist type checking for nullable arg types
check_func_arg has a plethora of weird if statements with empty branches. They work around the fact that *_OR_NULL argument types should accept a SCALAR_VALUE register, as long as it's value is 0. These statements make it difficult to reason about the type checking logic. Instead, skip more detailed type checking logic iff the register is 0, and the function expects a nullable type. This allows simplifying the type checking itself. Signed-off-by: Lorenz Bauer <lmb@cloudflare.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Andrii Nakryiko <andriin@fb.com> Acked-by: Martin KaFai Lau <kafai@fb.com> Link: https://lore.kernel.org/bpf/20200921121227.255763-11-lmb@cloudflare.com
Diffstat (limited to 'kernel/scs.c')
0 files changed, 0 insertions, 0 deletions