Re: [PATCH] staging: nvec: kbd: use -EINVAL instead of -1
From: Dan Carpenter
Date: Wed Mar 04 2026 - 03:13:00 EST
On Wed, Mar 04, 2026 at 01:13:05PM +0530, Soham Kute wrote:
> Hi Dan,
>
> Thanks for pointing me to smatch. I built the DB and ran the queries.
>
> >From what I can see, dev->event() is called in input_handle_event()
> but the return value is not propagated back up. The smatch caller_info
> table shows type INTERNAL for that call which I understand means the
> return value stays internal and never reaches the caller of
> input_event().
>
> So yes, this patch has no runtime effect. The reason I sent it was
> that pcspkr.c uses -EINVAL in the same type of event callback, so I
> thought nvec_kbd should be consistent with that.
Put that kind of thing in the commit message.
"This patch has no effect on runtime but returning proper error codes
is the correct thing and it makes it more consistent with other functions
that implement it such whatever_function() in pcspkr.c"
>
> Also noticed atkbd.c has the same -1 in its event callback. Should I
> send a fix for that too?
If you want to do that, then sure, absolutely.
regards,
dan carpenter