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] [thread-next>] [day] [month] [year] [list]
Message-ID: <6ab68169-dde6-b5ba-0909-fa685bd24aac@rasmusvillemoes.dk>
Date:   Thu, 13 Feb 2020 14:35:18 +0100
From:   Rasmus Villemoes <linux@...musvillemoes.dk>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Gustavo A. R. Silva" <gustavo@...eddedor.com>
Cc:     Timur Tabi <timur@...nel.org>, Li Yang <leoyang.li@....com>,
        Anton Vorontsov <avorontsov@...mvista.com>,
        kbuild test robot <lkp@...el.com>, linux-usb@...r.kernel.org,
        linux-kernel@...r.kernel.org, Joe Perches <joe@...ches.com>
Subject: Re: [PATCH] usb: host: fhci-hcd: annotate PIPE_CONTROL switch case
 with fallthrough

On 13/02/2020 13.56, Greg Kroah-Hartman wrote:

>> diff --git a/drivers/usb/host/fhci-hcd.c b/drivers/usb/host/fhci-hcd.c
>> index 04733876c9c6..a8e1048278d0 100644
>> --- a/drivers/usb/host/fhci-hcd.c
>> +++ b/drivers/usb/host/fhci-hcd.c
>> @@ -396,6 +396,7 @@ static int fhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
>>  	case PIPE_CONTROL:
>>  		/* 1 td fro setup,1 for ack */
>>  		size = 2;
>> +		fallthrough;
> 
> We have an attribute for that?
> 
> 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.

Rasmus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ