On Wed, Mar 11, 2026 at 8:10 AM Hari Bathini <[email protected]> wrote:
>
> >
> >> +
> >> +       /* Check zero-extension */
> >> +       if (val != (unsigned long)a)
> >> +               return 1;
> >> +       /* Check no sign-extension */
> >> +       if (val < 0)
> >> +               return 2;
> >> +
> >> +       val = b;
> >> +       if (val != (unsigned long)b)
> >> +               return 3;
> >> +       if (val < 0)
> >> +               return 4;
> >> +
> >> +       val = c;
> >> +       if (val != (unsigned long)c)
> >> +               return 5;
> >> +       if (val < 0)
> >> +               return 6;
> >> +
> >> +       return 0;
> >> +}
> >
> > Overall this looks very useful.
> > I would expand with another test where a,b,c are s8,s16,s32.
>
> Slightly different approach but kfunc_call_test4/bpf_kfunc_call_test4
> cover signed arguments already?

Ahh. Then may be tweak it to adopt similar fine grained
error reporting as your bpf_kfunc_call_test5()
or go other way around an collapse all errors the way test4 is doing it.

Reply via email to