[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHP4M8XWbxVDAeN=4YGX93gNLDDWE0GS8_sKkNv2p_-yBjjHVg@mail.gmail.com>
Date: Mon, 8 Nov 2021 14:25:31 +0530
From: Ajay Garg <ajaygargnsit@...il.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Emil Renner Berthing <kernel@...il.dk>,
"open list:SERIAL DRIVERS" <linux-serial@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Pavel Skripkin <paskripkin@...il.com>
Subject: Re: [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@...il.com>
> > * Andy Shevchenko <andy.shevchenko@...il.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
Powered by blists - more mailing lists