From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C38F9C43387 for ; Mon, 17 Dec 2018 13:58:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 89D852145D for ; Mon, 17 Dec 2018 13:58:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545055117; bh=fMAJHnfi5IG4Ruj4T3wXEl4IsIwZe6gAaTaAQFNacZ4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=GMyzBlq/2pRQJeX0NaUWTkdgYACfAGM8roV1vReeBARiDPpiwrg6C9mBI0jb4uq41 VhiQrwG6Xlz8eYbCcPa7snkKL8E5cCCwf80LiGagda7XoWARCs3fI2Hu2gSk7uipY8 2AP+G1zdv/nhzcCvdgk99zKc5GoMnJD9tyzMSqX4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727789AbeLQN6g (ORCPT ); Mon, 17 Dec 2018 08:58:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:57334 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727651AbeLQN6g (ORCPT ); Mon, 17 Dec 2018 08:58:36 -0500 Received: from localhost (173-25-171-118.client.mchsi.com [173.25.171.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4B0282133F; Mon, 17 Dec 2018 13:58:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545055115; bh=fMAJHnfi5IG4Ruj4T3wXEl4IsIwZe6gAaTaAQFNacZ4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MIC4UmgFCJhAASGPwQ/R2JehEu2jCJ92mdSwyM6IM8o6/CSwqPcpfwolKflSUM0hk V88ifYAgrUgP1iIamyzKZt8igCCvW8aWslmUwQtH/eq9+OVHfES6DGsePBfPfcFI9m VsOaWTNvt0nsG/UvXozjweEkDCP05izvsR5TMcK0= Date: Mon, 17 Dec 2018 07:58:33 -0600 From: Bjorn Helgaas To: Andrey Smirnov Cc: Lorenzo Pieralisi , Fabio Estevam , Chris Healy , Lucas Stach , Leonard Crestez , "A.s. Dong" , Richard Zhu , linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: Re: [PATCH 3/3] PCI: imx6: Make fallthrough comments more consistent Message-ID: <20181217135833.GJ20725@google.com> References: <20181216230916.22982-1-andrew.smirnov@gmail.com> <20181216230916.22982-4-andrew.smirnov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181216230916.22982-4-andrew.smirnov@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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 > Cc: Fabio Estevam > Cc: Chris Healy > Cc: Lucas Stach > Cc: Leonard Crestez > Cc: "A.s. Dong" > Cc: Richard Zhu > Cc: linux-imx@nxp.com > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > Cc: linux-pci@vger.kernel.org > Suggested-by: Bjorn Helgaas I didn't make it very clear, but my suggestion was really to remove the annotation completely; see below. > Signed-off-by: Andrey Smirnov > --- > 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); From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08F90C43387 for ; Mon, 17 Dec 2018 13:58:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CDD332146E for ; Mon, 17 Dec 2018 13:58:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="S3taw1Oy"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="MIC4UmgF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CDD332146E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=D0WjyhEkgN3Xztum5xmrAVH7rQiWmq3ow6sCkWRabR4=; b=S3taw1Oyka8NbW S0rPQUTODn44r4xVw9o7tvKI/M7lgo/mammmnIuOZRQdLFhIRU2zr41OkPtKtyHRjqO5SLoD4aDhd OR2K+0q3a5emiI8yPDKau6JrmsVDZaTZm13pL8P6eAfKaM3QmUUnWWLp0Vm53vfL7k0CdqB+RKi3z LB5py+yF19GtdPUCR9I6ix4O4fs3OQCHZonNhgAzj/RJf/Tzg/KzGCsCG65h6YVoD9epnzlBsBrHt 8SQv4utnCeLoJFjJ2mo1ASTwbWzLpNwbSeg63I4ShOP8qdfhWMwtXTzB6Dj0Xpvy94uQBQMiEBaHY CJ7XoKgDoOdfEDL5Tr4w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gYtQ1-00062N-H9; Mon, 17 Dec 2018 13:58:49 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gYtPy-00061J-7V for linux-arm-kernel@lists.infradead.org; Mon, 17 Dec 2018 13:58:47 +0000 Received: from localhost (173-25-171-118.client.mchsi.com [173.25.171.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4B0282133F; Mon, 17 Dec 2018 13:58:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545055115; bh=fMAJHnfi5IG4Ruj4T3wXEl4IsIwZe6gAaTaAQFNacZ4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MIC4UmgFCJhAASGPwQ/R2JehEu2jCJ92mdSwyM6IM8o6/CSwqPcpfwolKflSUM0hk V88ifYAgrUgP1iIamyzKZt8igCCvW8aWslmUwQtH/eq9+OVHfES6DGsePBfPfcFI9m VsOaWTNvt0nsG/UvXozjweEkDCP05izvsR5TMcK0= Date: Mon, 17 Dec 2018 07:58:33 -0600 From: Bjorn Helgaas To: Andrey Smirnov Subject: Re: [PATCH 3/3] PCI: imx6: Make fallthrough comments more consistent Message-ID: <20181217135833.GJ20725@google.com> References: <20181216230916.22982-1-andrew.smirnov@gmail.com> <20181216230916.22982-4-andrew.smirnov@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20181216230916.22982-4-andrew.smirnov@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181217_055846_289536_C214503A X-CRM114-Status: GOOD ( 16.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "A.s. Dong" , Lorenzo Pieralisi , Richard Zhu , linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com, Fabio Estevam , Leonard Crestez , Chris Healy , Lucas Stach Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 > Cc: Fabio Estevam > Cc: Chris Healy > Cc: Lucas Stach > Cc: Leonard Crestez > Cc: "A.s. Dong" > Cc: Richard Zhu > Cc: linux-imx@nxp.com > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > Cc: linux-pci@vger.kernel.org > Suggested-by: Bjorn Helgaas I didn't make it very clear, but my suggestion was really to remove the annotation completely; see below. > Signed-off-by: Andrey Smirnov > --- > 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); _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel