On Tue, Dec 06, 2022 at 03:09:54PM -0800, Dave Marchevsky wrote: > > -static int process_kf_arg_ptr_to_list_head(struct bpf_verifier_env *env, > +static bool is_bpf_rbtree_api_kfunc(u32 btf_id) > +{ > + return btf_id == special_kfunc_list[KF_bpf_rbtree_add] || > + btf_id == special_kfunc_list[KF_bpf_rbtree_remove] || > + btf_id == special_kfunc_list[KF_bpf_rbtree_first]; > +} > + > +static bool is_bpf_datastructure_api_kfunc(u32 btf_id) > +{ > + return is_bpf_list_api_kfunc(btf_id) || is_bpf_rbtree_api_kfunc(btf_id); > +} static bool is_bpf_graph_api_kfunc(u32 btf_id) { return is_bpf_list_api_kfunc(btf_id) || is_bpf_rbtree_api_kfunc(btf_id); } would read well here. Much shorter too.