linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ajay Garg <ajaygargnsit@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Emil Renner Berthing <kernel@esmil.dk>,
	"open list:SERIAL DRIVERS" <linux-serial@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Pavel Skripkin <paskripkin@gmail.com>
Subject: Re: [PATCH v4] tty: vt: keyboard: add default switch-case, to handle smatch-warnings in method vt_do_kdgkb_ioctl
Date: Mon, 8 Nov 2021 14:25:31 +0530	[thread overview]
Message-ID: <CAHP4M8XWbxVDAeN=4YGX93gNLDDWE0GS8_sKkNv2p_-yBjjHVg@mail.gmail.com> (raw)
In-Reply-To: <CAHp75VcacFAvsW6zmHe8fbnetcZq4xY_LZunZjBDG3ZdfS9NRQ@mail.gmail.com>

> > 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

  reply	other threads:[~2021-11-08  8:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-07  3:17 [PATCH v4] tty: vt: keyboard: add default switch-case, to handle smatch-warnings in method vt_do_kdgkb_ioctl Ajay Garg
2021-11-08  7:03 ` Jiri Slaby
2021-11-08  8:36 ` Andy Shevchenko
2021-11-08  8:55   ` Ajay Garg [this message]
2021-11-08  9:41 ` Johan Hovold
2021-11-08 13:51   ` Ajay Garg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHP4M8XWbxVDAeN=4YGX93gNLDDWE0GS8_sKkNv2p_-yBjjHVg@mail.gmail.com' \
    --to=ajaygargnsit@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=kernel@esmil.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=paskripkin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).