]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit31566c6c0fa44779e73a7151f0e84a4690e3f0c5
tree966784915300da93b4732ab8704af443465a2d4d
parentd494c8e5c2934bd770da1ba0ee0b782305f3d06a
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