Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bpf: Move btf_type_is_struct_ptr() under CONFIG_BPF_SYSCALL

The static inline btf_type_is_struct_ptr() function calls
btf_type_skip_modifiers() which is guarded by CONFIG_BPF_SYSCALL.
btf_type_is_struct_ptr() is also only called by CONFIG_BPF_SYSCALL
ifdef code, so let's only expose btf_type_is_struct_ptr() if
CONFIG_BPF_SYSCALL is defined.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Link: https://lore.kernel.org/r/20241104060300.421403-1-alistair.francis@wdc.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Alistair Francis and committed by
Alexei Starovoitov
9a783139 f2daa5a5

+10 -11
+10 -11
include/linux/btf.h
··· 582 582 bool btf_types_are_same(const struct btf *btf1, u32 id1, 583 583 const struct btf *btf2, u32 id2); 584 584 int btf_check_iter_arg(struct btf *btf, const struct btf_type *func, int arg_idx); 585 + 586 + static inline bool btf_type_is_struct_ptr(struct btf *btf, const struct btf_type *t) 587 + { 588 + if (!btf_type_is_ptr(t)) 589 + return false; 590 + 591 + t = btf_type_skip_modifiers(btf, t->type, NULL); 592 + 593 + return btf_type_is_struct(t); 594 + } 585 595 #else 586 596 static inline const struct btf_type *btf_type_by_id(const struct btf *btf, 587 597 u32 type_id) ··· 671 661 return -EOPNOTSUPP; 672 662 } 673 663 #endif 674 - 675 - static inline bool btf_type_is_struct_ptr(struct btf *btf, const struct btf_type *t) 676 - { 677 - if (!btf_type_is_ptr(t)) 678 - return false; 679 - 680 - t = btf_type_skip_modifiers(btf, t->type, NULL); 681 - 682 - return btf_type_is_struct(t); 683 - } 684 - 685 664 #endif