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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181217135833.GJ20725@google.com>
Date:   Mon, 17 Dec 2018 07:58:33 -0600
From:   Bjorn Helgaas <helgaas@...nel.org>
To:     Andrey Smirnov <andrew.smirnov@...il.com>
Cc:     Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        Fabio Estevam <fabio.estevam@....com>,
        Chris Healy <cphealy@...il.com>,
        Lucas Stach <l.stach@...gutronix.de>,
        Leonard Crestez <leonard.crestez@....com>,
        "A.s. Dong" <aisheng.dong@....com>,
        Richard Zhu <hongxing.zhu@....com>, linux-imx@....com,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-pci@...r.kernel.org
Subject: Re: [PATCH 3/3] PCI: imx6: Make fallthrough comments more consistent

On Sun, Dec 16, 2018 at 03:09:16PM -0800, Andrey Smirnov wrote:
> Convert all fallthrough comments to say "fall through", as well as
> modify their placement to the point where the "break" would normally
> be.
> 
> Cc: Bjorn Helgaas <bhelgaas@...gle.com>
> Cc: Fabio Estevam <fabio.estevam@....com>
> Cc: Chris Healy <cphealy@...il.com>
> Cc: Lucas Stach <l.stach@...gutronix.de>
> Cc: Leonard Crestez <leonard.crestez@....com>
> Cc: "A.s. Dong" <aisheng.dong@....com>
> Cc: Richard Zhu <hongxing.zhu@....com>
> Cc: linux-imx@....com
> Cc: linux-arm-kernel@...ts.infradead.org
> Cc: linux-kernel@...r.kernel.org
> Cc: linux-pci@...r.kernel.org
> Suggested-by: Bjorn Helgaas <helgaas@...nel.org>

I didn't make it very clear, but my suggestion was really to remove
the annotation completely; see below.

> Signed-off-by: Andrey Smirnov <andrew.smirnov@...il.com>
> ---
>  drivers/pci/controller/dwc/pci-imx6.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
> index 59658577e81d..a0510e185d44 100644
> --- a/drivers/pci/controller/dwc/pci-imx6.c
> +++ b/drivers/pci/controller/dwc/pci-imx6.c
> @@ -362,7 +362,8 @@ static void imx6_pcie_assert_core_reset(struct imx6_pcie *imx6_pcie)
>  
>  	switch (imx6_pcie->variant) {
>  	case IMX7D:
> -	case IMX8MQ: /* FALLTHROUGH */
> +		/* fall through */
> +	case IMX8MQ:
>  		reset_control_assert(imx6_pcie->pciephy_reset);
>  		reset_control_assert(imx6_pcie->apps_reset);
>  		break;

IMO this use of "fall through" is superfluous and unusual in the Linux
source.

A "fall through" comment would be useful if the IMX7D case had
executable code but no "break".  Then the comment shows that the
intent was to execute *both* the IMX7D code and the IMX8MQ code and
the lack of a "break" was intentional.

In this case, the intent is to treat IMX7D and IMX8MQ the same, and
there's no executable code specifically for the IMX7D.  I think it's
easiest to read that when the list of identical cases is all together
without the comment in the middle, i.e., as

>  	case IMX7D:
> 	case IMX8MQ:
>  		reset_control_assert(imx6_pcie->pciephy_reset);

rather than this:

>  	case IMX7D:
> 		/* fall through */
> 	case IMX8MQ:
>  		reset_control_assert(imx6_pcie->pciephy_reset);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ