Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: "Krzysztof Wilczyński" <kw@linux.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Rob Herring <robh@kernel.org>,
	linux-pci@vger.kernel.org
Subject: Re: [PATCH] PCI: artpec6: Remove surplus break statement after return
Date: Thu, 1 Jul 2021 14:56:14 -0500	[thread overview]
Message-ID: <20210701195614.GA84355@bjorn-Precision-5520> (raw)
In-Reply-To: <20210701191640.1493543-1-kw@linux.com>

On Thu, Jul 01, 2021 at 07:16:40PM +0000, Krzysztof Wilczyński wrote:
> As part of code refactoring completed in the commit a0fd361db8e5 ("PCI:
> dwc: Move "dbi", "dbi2", and "addr_space" resource setup into common
> code") the function artpec6_add_pcie_ep() has been removed and the call
> to the dw_pcie_ep_init() has been moved into artpec6_pcie_probe().
> 
> This change left a break statement behind that is not needed any more as
> as the function artpec6_pcie_probe() return immediately after making
> a call to dw_pcie_ep_init().
> 
> Thus remove this surplus break statement that became a dead code.
> 
> Signed-off-by: Krzysztof Wilczyński <kw@linux.com>

According to

  $ git grep -n -A1 "return.*;" drivers/pci

there's at least one more instance in
drivers/pci/controller/dwc/pcie-designware-plat.c.

> ---
>  drivers/pci/controller/dwc/pcie-artpec6.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-artpec6.c b/drivers/pci/controller/dwc/pcie-artpec6.c
> index 597c282f586c..739871bece75 100644
> --- a/drivers/pci/controller/dwc/pcie-artpec6.c
> +++ b/drivers/pci/controller/dwc/pcie-artpec6.c
> @@ -445,7 +445,6 @@ static int artpec6_pcie_probe(struct platform_device *pdev)
>  		pci->ep.ops = &pcie_ep_ops;
>  
>  		return dw_pcie_ep_init(&pci->ep);
> -		break;
>  	}

Not related to your patch, but I'm not really a fan of the block here
(needed because of the local "u32 val" declaration) because we end up
with two close braces at the same indent level.  I'd rather declare
the variable at the top with the other local variables and dispense
with the braces.

>  	default:
>  		dev_err(dev, "INVALID device type %d\n", artpec6_pcie->mode);
> -- 
> 2.32.0
> 

  reply	other threads:[~2021-07-01 19:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01 19:16 [PATCH] PCI: artpec6: Remove surplus break statement after return Krzysztof Wilczyński
2021-07-01 19:56 ` Bjorn Helgaas [this message]
2021-07-01 20:50   ` Krzysztof Wilczyński

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=20210701195614.GA84355@bjorn-Precision-5520 \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=jesper.nilsson@axis.com \
    --cc=kw@linux.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=robh@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