On Tue, 2024-07-09 at 16:42 -0700, Andrii Nakryiko wrote: [...] > > @@ -10261,6 +10261,24 @@ static void update_loop_inline_state(struct bpf_verifier_env *env, u32 subprogno > > state->callback_subprogno == subprogno); > > } > > > > +static int get_helper_proto(struct bpf_verifier_env *env, int func_id, > > + const struct bpf_func_proto **ptr) > > +{ > > + const struct bpf_func_proto *result = NULL; > > + > > + if (func_id < 0 || func_id >= __BPF_FUNC_MAX_ID) > > + return -ERANGE; > > + > > + if (env->ops->get_func_proto) > > + result = env->ops->get_func_proto(func_id, env->prog); > > + > > + if (!result) > > + return -EINVAL; > > result is a bit unnecessary. We could do either > > *ptr = NULL; > if (env->ops->get_func_proto) > *ptr = env->ops->get_func_proto(func_id, env->prog); > return *ptr ? 0 : -EINVAL; > > > or just > > if (!env->ops->get_func_proto) > return -EINVAL; > > *ptr = env->ops->get_func_proto(func_id, env->prog); > > return *ptr ? 0 : -EINVAL; Ok, will change in v3. [...]