linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: imx6: Remove unused assignment to variable ret
@ 2021-10-03  2:54 Krzysztof Wilczyński
  2021-10-05  9:06 ` Lorenzo Pieralisi
  0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Wilczyński @ 2021-10-03  2:54 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Lorenzo Pieralisi, Richard Zhu, Lucas Stach, Rob Herring,
	linux-pci, linux-arm-kernel

Previously, the maximum link speed was set following an "fsl,max-link-speed"
property read, and should the read failed, then the PCIe generation was
manually set to PCIe Gen1 and thus limiting the link speed to 2.5 GT/s.

Code refactoring completed in the commit 39bc5006501c ("PCI: dwc:
Centralize link gen setting") changed to the logic that was previously
used to limit the maximum link speed leaving behind an unused assignment
to a variable "ret".

Since the value returned from the of_property_read_u32() and stored in
the variable "ret" is never used in any meaningful way, and it's also
immediately reassigned in the code that follows, the assignment can be
removed.

Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
---
 drivers/pci/controller/dwc/pci-imx6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index 80fc98acf097..26f49f797b0f 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -1132,7 +1132,7 @@ static int imx6_pcie_probe(struct platform_device *pdev)
 
 	/* Limit link speed */
 	pci->link_gen = 1;
-	ret = of_property_read_u32(node, "fsl,max-link-speed", &pci->link_gen);
+	of_property_read_u32(node, "fsl,max-link-speed", &pci->link_gen);
 
 	imx6_pcie->vpcie = devm_regulator_get_optional(&pdev->dev, "vpcie");
 	if (IS_ERR(imx6_pcie->vpcie)) {
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] PCI: imx6: Remove unused assignment to variable ret
  2021-10-03  2:54 [PATCH] PCI: imx6: Remove unused assignment to variable ret Krzysztof Wilczyński
@ 2021-10-05  9:06 ` Lorenzo Pieralisi
  0 siblings, 0 replies; 2+ messages in thread
From: Lorenzo Pieralisi @ 2021-10-05  9:06 UTC (permalink / raw)
  To: Krzysztof Wilczyński, Bjorn Helgaas
  Cc: Lorenzo Pieralisi, Rob Herring, linux-arm-kernel, linux-pci,
	Lucas Stach, Richard Zhu

On Sun, 3 Oct 2021 02:54:39 +0000, Krzysztof Wilczyński wrote:
> Previously, the maximum link speed was set following an "fsl,max-link-speed"
> property read, and should the read failed, then the PCIe generation was
> manually set to PCIe Gen1 and thus limiting the link speed to 2.5 GT/s.
> 
> Code refactoring completed in the commit 39bc5006501c ("PCI: dwc:
> Centralize link gen setting") changed to the logic that was previously
> used to limit the maximum link speed leaving behind an unused assignment
> to a variable "ret".
> 
> [...]

Applied to pci/imx6, thanks!

[1/1] PCI: imx6: Remove unused assignment to variable ret
      https://git.kernel.org/lpieralisi/pci/c/65315ec52c

Thanks,
Lorenzo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-05  9:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-03  2:54 [PATCH] PCI: imx6: Remove unused assignment to variable ret Krzysztof Wilczyński
2021-10-05  9:06 ` Lorenzo Pieralisi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).