linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	Timur Tabi <timur@kernel.org>, Li Yang <leoyang.li@nxp.com>,
	Anton Vorontsov <avorontsov@ru.mvista.com>,
	kbuild test robot <lkp@intel.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Joe Perches <joe@perches.com>
Subject: Re: [PATCH] usb: host: fhci-hcd: annotate PIPE_CONTROL switch case with fallthrough
Date: Mon, 17 Feb 2020 15:12:21 +0100	[thread overview]
Message-ID: <a1f0f024-c1e5-8ff5-f717-f5098b4eb78d@rasmusvillemoes.dk> (raw)
In-Reply-To: <20200217093836.GA37937@kroah.com>

On 17/02/2020 10.38, Greg Kroah-Hartman wrote:
> On Thu, Feb 13, 2020 at 02:35:18PM +0100, Rasmus Villemoes wrote:
>> On 13/02/2020 13.56, Greg Kroah-Hartman wrote:
>>
>>> Shouldn't this be /* fall through */ instead?
>>>
>>> Gustavo, what's the best practice here, I count only a few
>>> "fallthrough;" instances in the kernel, although one is in our coding
>>> style document, and thousands of the /* */ version.
>>
>> Yes, I went with the attribute/macro due to that, and the history is
>> that Linus applied Joe's patches directly
>> (https://lore.kernel.org/lkml/CAHk-=whOF8heTGz5tfzYUBp_UQQzSWNJ_50M7-ECXkfFRDQWFA@mail.gmail.com/),
>> so I assumed that meant the Penguin decided that the attribute/macro is
>> the right thing to do for new code, while existing comment annotations
>> can be left alone or changed piecemeal as code gets refactored anyway.
> 
> But, to be fair, Gustavo went and fixed up thousands of these, with the
> /* */ version, not the attribute.
> 
> Gustavo, can coverity notice the "fallthrough;" attribute properly?  I
> don't want to start adding things that end up triggering
> false-positives.

I'm not Gustavo, and I don't know the answer, but 1.5 years ago some guy
named greg k-h suggested that coverity does grok the fallthrough attribute:

https://patchwork.kernel.org/cover/10651357/#22279095

Rasmus

  reply	other threads:[~2020-02-17 14:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-13  8:54 [PATCH] usb: host: fhci-hcd: annotate PIPE_CONTROL switch case with fallthrough Rasmus Villemoes
2020-02-13 12:56 ` Greg Kroah-Hartman
2020-02-13 13:35   ` Rasmus Villemoes
2020-02-13 15:23     ` [PATCH] checkpatch: Prefer fallthrough; over fallthrough comments Joe Perches
2020-02-17  9:38     ` [PATCH] usb: host: fhci-hcd: annotate PIPE_CONTROL switch case with fallthrough Greg Kroah-Hartman
2020-02-17 14:12       ` Rasmus Villemoes [this message]
2020-02-17 14:18         ` Greg Kroah-Hartman
2020-02-17 16:15           ` Gustavo A. R. Silva
2020-02-17 16:29             ` Greg Kroah-Hartman
2020-02-17 17:12   ` Gustavo A. R. Silva
2020-02-17 17:33     ` Joe Perches
2020-02-17 19:44       ` Rasmus Villemoes
2020-02-13 21:11 ` Leo Li
2020-02-17 17:28 ` Gustavo A. R. Silva

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=a1f0f024-c1e5-8ff5-f717-f5098b4eb78d@rasmusvillemoes.dk \
    --to=linux@rasmusvillemoes.dk \
    --cc=avorontsov@ru.mvista.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavo@embeddedor.com \
    --cc=joe@perches.com \
    --cc=leoyang.li@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=timur@kernel.org \
    /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).