On Tue, 18 Jul 2023 08:46:34 +0900 Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx> wrote: > > > + * Get function parameter with the number of parameters. > > > + * This can return NULL if the function has no parameters. > > > > " It can return EINVAL if this function's parameters are NULL." > > No, as you can see the code, if btf_type_vlen(func_proto) returns 0 (means > the function proto type has no parameters), btf_get_func_param() returns > NULL. This is important point because user needs to use IS_ERR_OR_NULL(ret) > instead of IS_ERR(ret). I didn't mean to replace what you had, I meant you left that part out. In other words, you have to check for IS_ERR_OR_NULL(ret), not just "!ret". -- Steve > > > > > + */ > > > +const struct btf_param *btf_get_func_param(const struct btf_type *func_proto, s32 *nr) > > > +{ > > > + if (!func_proto || !nr) > > > + return ERR_PTR(-EINVAL); > > > +