lkml.org 
[lkml]   [2021]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v4] tty: vt: keyboard: add default switch-case, to handle smatch-warnings in method vt_do_kdgkb_ioctl
> > This usually happens when switch has no default case and static
> > analyzers and even sometimes compilers can’t prove that all possible
> > values are covered.
> >
> >
>
> One blank line is enough.
>
> > Many thanks to the following for review of previous versions :
> >
> > * Pavel Skripkin <paskripkin@gmail.com>
> > * Andy Shevchenko <andy.shevchenko@gmail.com>
> >
> >
>
> Ditto for each such case.

Ok, will take care of this in all my future-patches.


>
> ...
>
> > + default:
> > + kbs = NULL;
>
> > + ret = -ENOIOCTLCMD;
>
> Why is this? How is it supposed to work?

If there is no match for a cmd, causing the default-case to be hit, we
must return an error ret-code to the client.
The -ENOIOCTLCMD error ret-code has been chosen, on the same lines as
"vt_do_kdskled" method.


Thanks and Regards,
Ajay

\
 
 \ /
  Last update: 2021-11-08 09:56    [W:0.113 / U:0.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site