OSDN Git Service

bpf: Simplify cases in bpf_base_func_proto
authorTobias Klauser <tklauser@distanz.ch>
Wed, 27 Jan 2021 17:46:15 +0000 (18:46 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 29 Jan 2021 01:20:28 +0000 (02:20 +0100)
commit61ca36c8c4eb3bae35a285b1ae18c514cde65439
tree966784915300da93b4732ab8704af443465a2d4d
parent4c3384d7abe58a68d78fd1b8b3bffbf62e1e29a1
bpf: Simplify cases in bpf_base_func_proto

!perfmon_capable() is checked before the last switch(func_id) in
bpf_base_func_proto. Thus, the cases BPF_FUNC_trace_printk and
BPF_FUNC_snprintf_btf can be moved to that last switch(func_id) to omit
the inline !perfmon_capable() checks.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210127174615.3038-1-tklauser@distanz.ch
kernel/bpf/helpers.c