Skip to contentSkip to conversation

PCI: dwc: Remove surplus break statement after return

PATCH Applied Krzysztof Wilczyński 2 participants 2 messages Jul 1, 2021 – Jul 23, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: dwc: Remove surplus break statement after return

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 dw_plat_add_pcie_ep() has been removed and the call to the dw_pcie_ep_init() has been moved into dw_plat_pcie_probe().

This change left a break statement behind that is not needed any more as as the function dw_plat_pcie_probe() returns immediately after making a call to dw_pcie_ep_init().

Thus remove this surplus break statement that became a dead code.

---
 drivers/pci/controller/dwc/pcie-designware-plat.c | 1 -
 1 file changed, 1 deletion(-)
drivers/pci/controller/dwc/pcie-designware-plat.c +0 -1
index 9b397c807261..8851eb161a0e 100644
@@ -164,7 +164,6 @@ static int dw_plat_pcie_probe(struct platform_device *pdev)
 
 		pci->ep.ops = &pcie_ep_ops;
 		return dw_pcie_ep_init(&pci->ep);
-		break;
 	default:
 		dev_err(dev, "INVALID device type %d\n", dw_plat_pcie->mode);
 	}
Signature · 1 line
2.32.0
#1 lore raw
Quoted 10 lines · Krzysztof Wilczyński

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 dw_plat_add_pcie_ep() has been removed and the call to the dw_pcie_ep_init() has been moved into dw_plat_pcie_probe().

This change left a break statement behind that is not needed any more as as the function dw_plat_pcie_probe() returns immediately after making a call to dw_pcie_ep_init().

[...]

Applied to pci/dwc, thanks!

[1/1] PCI: dwc: Remove surplus break statement after return

      https://git.kernel.org/lpieralisi/pci/c/2999568def

Thanks,
Lorenzo