lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200805162102.GK3634@localhost>
Date:   Wed, 5 Aug 2020 18:21:02 +0200
From:   Johan Hovold <johan@...nel.org>
To:     Alex Elder <elder@...e.org>
Cc:     "Gustavo A. R. Silva" <gustavoars@...nel.org>,
        Johan Hovold <johan@...nel.org>, Alex Elder <elder@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        greybus-dev@...ts.linaro.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] greybus: Use fallthrough pseudo-keyword

On Wed, Aug 05, 2020 at 08:14:47AM -0500, Alex Elder wrote:
> On 7/28/20 5:37 PM, Alex Elder wrote:
> > On 7/27/20 1:32 PM, Gustavo A. R. Silva wrote:
> >> Replace the existing /* fall through */ comments and its variants with
> >> the new pseudo-keyword macro fallthrough[1].
> >>
> >> [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
> > 
> > Thanks for the patch.  It looks good, but it raises
> > another question I'd like discussion on.

Sorry about the late reply on this.

> It's been a week, and we heard back from Viresh (and Joe) on
> this, but no one else.  Viresh left out the break statement on
> the last case of the switch statement intentionally, arguing
> that it is not needed (much like a return statement at the end
> of a void function).  But he doesn't feel strongly enough
> insist it should stay that way.  I'm sure the others omitted
> the break statement intentionally as well.

I really don't mind break statements in the final case and often do add
them, but I'm a bit reluctant to suggest that this is something that
need "fixing". There are a ton of these all over the kernel, and I think
we have too many opportunities for people to do mechanical clean ups
already.

Especially after Gustavo's work, the only real argument for adding them
is mostly moot as the compiler would catch it if anyone adds a new case
and forgets about the break statement.

> Given no strong pushback, I'll ask you (Gustavo) to post a
> second patch adding the missing break statements I described
> (and look for any others I might have missed).  If you would
> prefer not to do that, just say so, and I will send out such
> a patch myself.

I'd probably just leave it as is, if only to not inspire others to send
copy-cat "fixes".

Johan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ