* [PATCH v2] PCI: s32g: Fix ports parsing
@ 2026-02-02 15:10 Vincent Guittot
2026-02-02 17:42 ` Frank Li
2026-02-03 12:57 ` Manivannan Sadhasivam
0 siblings, 2 replies; 7+ messages in thread
From: Vincent Guittot @ 2026-02-02 15:10 UTC (permalink / raw)
To: ciprianmarian.costea, s32, lpieralisi, kwilczynski, mani, robh,
bhelgaas, imx, linux-arm-kernel, linux-pci, linux-kernel
Cc: Vincent Guittot
No error return is missing after the loop resulting in removing the
ports from the list.
Fixes: 5cbc7d3e316e ("PCI: s32g: Add NXP S32G PCIe controller driver (RC)")
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
---
Change since v1:
- handle correctly the case when there is no child port
drivers/pci/controller/dwc/pcie-nxp-s32g.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-nxp-s32g.c b/drivers/pci/controller/dwc/pcie-nxp-s32g.c
index 47745749f75c..b3ec38099fa3 100644
--- a/drivers/pci/controller/dwc/pcie-nxp-s32g.c
+++ b/drivers/pci/controller/dwc/pcie-nxp-s32g.c
@@ -282,12 +282,12 @@ static int s32g_pcie_parse_ports(struct device *dev, struct s32g_pcie *s32g_pp)
ret = s32g_pcie_parse_port(s32g_pp, of_port);
if (ret)
- goto err_port;
+ break;
}
-err_port:
- list_for_each_entry_safe(port, tmp, &s32g_pp->ports, list)
- list_del(&port->list);
+ if (ret)
+ list_for_each_entry_safe(port, tmp, &s32g_pp->ports, list)
+ list_del(&port->list);
return ret;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH v2] PCI: s32g: Fix ports parsing 2026-02-02 15:10 [PATCH v2] PCI: s32g: Fix ports parsing Vincent Guittot @ 2026-02-02 17:42 ` Frank Li 2026-02-02 19:23 ` Vincent Guittot 2026-02-03 12:57 ` Manivannan Sadhasivam 1 sibling, 1 reply; 7+ messages in thread From: Frank Li @ 2026-02-02 17:42 UTC (permalink / raw) To: Vincent Guittot Cc: ciprianmarian.costea, s32, lpieralisi, kwilczynski, mani, robh, bhelgaas, imx, linux-arm-kernel, linux-pci, linux-kernel On Mon, Feb 02, 2026 at 04:10:50PM +0100, Vincent Guittot wrote: > No error return is missing after the loop resulting in removing the > ports from the list. > > Fixes: 5cbc7d3e316e ("PCI: s32g: Add NXP S32G PCIe controller driver (RC)") > Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org> > --- > > Change since v1: > - handle correctly the case when there is no child port > > drivers/pci/controller/dwc/pcie-nxp-s32g.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pcie-nxp-s32g.c b/drivers/pci/controller/dwc/pcie-nxp-s32g.c > index 47745749f75c..b3ec38099fa3 100644 > --- a/drivers/pci/controller/dwc/pcie-nxp-s32g.c > +++ b/drivers/pci/controller/dwc/pcie-nxp-s32g.c > @@ -282,12 +282,12 @@ static int s32g_pcie_parse_ports(struct device *dev, struct s32g_pcie *s32g_pp) > > ret = s32g_pcie_parse_port(s32g_pp, of_port); > if (ret) > - goto err_port; > + break; > } > > -err_port: > - list_for_each_entry_safe(port, tmp, &s32g_pp->ports, list) > - list_del(&port->list); break and goto is logical equal here. So only need below if (ret). Frank > + if (ret) > + list_for_each_entry_safe(port, tmp, &s32g_pp->ports, list) > + list_del(&port->list); > > return ret; > } > -- > 2.43.0 > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] PCI: s32g: Fix ports parsing 2026-02-02 17:42 ` Frank Li @ 2026-02-02 19:23 ` Vincent Guittot 2026-02-02 19:46 ` Frank Li 0 siblings, 1 reply; 7+ messages in thread From: Vincent Guittot @ 2026-02-02 19:23 UTC (permalink / raw) To: Frank Li Cc: ciprianmarian.costea, s32, lpieralisi, kwilczynski, mani, robh, bhelgaas, imx, linux-arm-kernel, linux-pci, linux-kernel On Mon, 2 Feb 2026 at 18:42, Frank Li <Frank.li@nxp.com> wrote: > > On Mon, Feb 02, 2026 at 04:10:50PM +0100, Vincent Guittot wrote: > > No error return is missing after the loop resulting in removing the > > ports from the list. > > > > Fixes: 5cbc7d3e316e ("PCI: s32g: Add NXP S32G PCIe controller driver (RC)") > > Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org> > > --- > > > > Change since v1: > > - handle correctly the case when there is no child port > > > > drivers/pci/controller/dwc/pcie-nxp-s32g.c | 8 ++++---- > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/pci/controller/dwc/pcie-nxp-s32g.c b/drivers/pci/controller/dwc/pcie-nxp-s32g.c > > index 47745749f75c..b3ec38099fa3 100644 > > --- a/drivers/pci/controller/dwc/pcie-nxp-s32g.c > > +++ b/drivers/pci/controller/dwc/pcie-nxp-s32g.c > > @@ -282,12 +282,12 @@ static int s32g_pcie_parse_ports(struct device *dev, struct s32g_pcie *s32g_pp) > > > > ret = s32g_pcie_parse_port(s32g_pp, of_port); > > if (ret) > > - goto err_port; > > + break; > > } > > > > -err_port: > > - list_for_each_entry_safe(port, tmp, &s32g_pp->ports, list) > > - list_del(&port->list); > > break and goto is logical equal here. So only need below if (ret). Yes it's similar that why I removed it, the goto becomes useless and make code less readable > > Frank > > > + if (ret) > > + list_for_each_entry_safe(port, tmp, &s32g_pp->ports, list) > > + list_del(&port->list); > > > > return ret; > > } > > -- > > 2.43.0 > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] PCI: s32g: Fix ports parsing 2026-02-02 19:23 ` Vincent Guittot @ 2026-02-02 19:46 ` Frank Li 2026-02-03 6:56 ` Vincent Guittot 0 siblings, 1 reply; 7+ messages in thread From: Frank Li @ 2026-02-02 19:46 UTC (permalink / raw) To: Vincent Guittot Cc: ciprianmarian.costea, s32, lpieralisi, kwilczynski, mani, robh, bhelgaas, imx, linux-arm-kernel, linux-pci, linux-kernel On Mon, Feb 02, 2026 at 08:23:30PM +0100, Vincent Guittot wrote: > On Mon, 2 Feb 2026 at 18:42, Frank Li <Frank.li@nxp.com> wrote: > > > > On Mon, Feb 02, 2026 at 04:10:50PM +0100, Vincent Guittot wrote: > > > No error return is missing after the loop resulting in removing the > > > ports from the list. > > > > > > Fixes: 5cbc7d3e316e ("PCI: s32g: Add NXP S32G PCIe controller driver (RC)") > > > Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org> > > > --- > > > > > > Change since v1: > > > - handle correctly the case when there is no child port > > > > > > drivers/pci/controller/dwc/pcie-nxp-s32g.c | 8 ++++---- > > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > > > diff --git a/drivers/pci/controller/dwc/pcie-nxp-s32g.c b/drivers/pci/controller/dwc/pcie-nxp-s32g.c > > > index 47745749f75c..b3ec38099fa3 100644 > > > --- a/drivers/pci/controller/dwc/pcie-nxp-s32g.c > > > +++ b/drivers/pci/controller/dwc/pcie-nxp-s32g.c > > > @@ -282,12 +282,12 @@ static int s32g_pcie_parse_ports(struct device *dev, struct s32g_pcie *s32g_pp) > > > > > > ret = s32g_pcie_parse_port(s32g_pp, of_port); > > > if (ret) > > > - goto err_port; > > > + break; > > > } > > > > > > -err_port: > > > - list_for_each_entry_safe(port, tmp, &s32g_pp->ports, list) > > > - list_del(&port->list); > > > > break and goto is logical equal here. So only need below if (ret). > > Yes it's similar that why I removed it, the goto becomes useless and > make code less readable But don't suggest change in this fixes patch, which should focus on the key part. Frank > > > > > Frank > > > > > + if (ret) > > > + list_for_each_entry_safe(port, tmp, &s32g_pp->ports, list) > > > + list_del(&port->list); > > > > > > return ret; > > > } > > > -- > > > 2.43.0 > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] PCI: s32g: Fix ports parsing 2026-02-02 19:46 ` Frank Li @ 2026-02-03 6:56 ` Vincent Guittot 2026-02-03 15:41 ` Frank Li 0 siblings, 1 reply; 7+ messages in thread From: Vincent Guittot @ 2026-02-03 6:56 UTC (permalink / raw) To: Frank Li Cc: ciprianmarian.costea, s32, lpieralisi, kwilczynski, mani, robh, bhelgaas, imx, linux-arm-kernel, linux-pci, linux-kernel On Mon, 2 Feb 2026 at 20:46, Frank Li <Frank.li@nxp.com> wrote: > > On Mon, Feb 02, 2026 at 08:23:30PM +0100, Vincent Guittot wrote: > > On Mon, 2 Feb 2026 at 18:42, Frank Li <Frank.li@nxp.com> wrote: > > > > > > On Mon, Feb 02, 2026 at 04:10:50PM +0100, Vincent Guittot wrote: > > > > No error return is missing after the loop resulting in removing the > > > > ports from the list. > > > > > > > > Fixes: 5cbc7d3e316e ("PCI: s32g: Add NXP S32G PCIe controller driver (RC)") > > > > Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org> > > > > --- > > > > > > > > Change since v1: > > > > - handle correctly the case when there is no child port > > > > > > > > drivers/pci/controller/dwc/pcie-nxp-s32g.c | 8 ++++---- > > > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > > > > > diff --git a/drivers/pci/controller/dwc/pcie-nxp-s32g.c b/drivers/pci/controller/dwc/pcie-nxp-s32g.c > > > > index 47745749f75c..b3ec38099fa3 100644 > > > > --- a/drivers/pci/controller/dwc/pcie-nxp-s32g.c > > > > +++ b/drivers/pci/controller/dwc/pcie-nxp-s32g.c > > > > @@ -282,12 +282,12 @@ static int s32g_pcie_parse_ports(struct device *dev, struct s32g_pcie *s32g_pp) > > > > > > > > ret = s32g_pcie_parse_port(s32g_pp, of_port); > > > > if (ret) > > > > - goto err_port; > > > > + break; > > > > } > > > > > > > > -err_port: > > > > - list_for_each_entry_safe(port, tmp, &s32g_pp->ports, list) > > > > - list_del(&port->list); > > > > > > break and goto is logical equal here. So only need below if (ret). > > > > Yes it's similar that why I removed it, the goto becomes useless and > > make code less readable > > But don't suggest change in this fixes patch, which should focus on the > key part. It's not a suggested change, it's the fix. err_port is now wrong because it's the path for all cases. > > Frank > > > > > > > > > Frank > > > > > > > + if (ret) > > > > + list_for_each_entry_safe(port, tmp, &s32g_pp->ports, list) > > > > + list_del(&port->list); > > > > > > > > return ret; > > > > } > > > > -- > > > > 2.43.0 > > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] PCI: s32g: Fix ports parsing 2026-02-03 6:56 ` Vincent Guittot @ 2026-02-03 15:41 ` Frank Li 0 siblings, 0 replies; 7+ messages in thread From: Frank Li @ 2026-02-03 15:41 UTC (permalink / raw) To: Vincent Guittot Cc: ciprianmarian.costea, s32, lpieralisi, kwilczynski, mani, robh, bhelgaas, imx, linux-arm-kernel, linux-pci, linux-kernel On Tue, Feb 03, 2026 at 07:56:23AM +0100, Vincent Guittot wrote: > On Mon, 2 Feb 2026 at 20:46, Frank Li <Frank.li@nxp.com> wrote: > > > > On Mon, Feb 02, 2026 at 08:23:30PM +0100, Vincent Guittot wrote: > > > On Mon, 2 Feb 2026 at 18:42, Frank Li <Frank.li@nxp.com> wrote: > > > > > > > > On Mon, Feb 02, 2026 at 04:10:50PM +0100, Vincent Guittot wrote: > > > > > No error return is missing after the loop resulting in removing the > > > > > ports from the list. > > > > > > > > > > Fixes: 5cbc7d3e316e ("PCI: s32g: Add NXP S32G PCIe controller driver (RC)") > > > > > Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org> > > > > > --- > > > > > > > > > > Change since v1: > > > > > - handle correctly the case when there is no child port > > > > > > > > > > drivers/pci/controller/dwc/pcie-nxp-s32g.c | 8 ++++---- > > > > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > > > > > > > diff --git a/drivers/pci/controller/dwc/pcie-nxp-s32g.c b/drivers/pci/controller/dwc/pcie-nxp-s32g.c > > > > > index 47745749f75c..b3ec38099fa3 100644 > > > > > --- a/drivers/pci/controller/dwc/pcie-nxp-s32g.c > > > > > +++ b/drivers/pci/controller/dwc/pcie-nxp-s32g.c > > > > > @@ -282,12 +282,12 @@ static int s32g_pcie_parse_ports(struct device *dev, struct s32g_pcie *s32g_pp) > > > > > > > > > > ret = s32g_pcie_parse_port(s32g_pp, of_port); > > > > > if (ret) > > > > > - goto err_port; > > > > > + break; > > > > > } > > > > > > > > > > -err_port: > > > > > - list_for_each_entry_safe(port, tmp, &s32g_pp->ports, list) > > > > > - list_del(&port->list); > > > > > > > > break and goto is logical equal here. So only need below if (ret). > > > > > > Yes it's similar that why I removed it, the goto becomes useless and > > > make code less readable > > > > But don't suggest change in this fixes patch, which should focus on the > > key part. > > It's not a suggested change, it's the fix. err_port is now wrong > because it's the path for all cases. But "goto" is the same as orginal "break". Really fix is below "if (ret)". Frank > > > > > Frank > > > > > > > > > > > > > Frank > > > > > > > > > + if (ret) > > > > > + list_for_each_entry_safe(port, tmp, &s32g_pp->ports, list) > > > > > + list_del(&port->list); > > > > > > > > > > return ret; > > > > > } > > > > > -- > > > > > 2.43.0 > > > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] PCI: s32g: Fix ports parsing 2026-02-02 15:10 [PATCH v2] PCI: s32g: Fix ports parsing Vincent Guittot 2026-02-02 17:42 ` Frank Li @ 2026-02-03 12:57 ` Manivannan Sadhasivam 1 sibling, 0 replies; 7+ messages in thread From: Manivannan Sadhasivam @ 2026-02-03 12:57 UTC (permalink / raw) To: ciprianmarian.costea, s32, lpieralisi, kwilczynski, robh, bhelgaas, imx, linux-arm-kernel, linux-pci, linux-kernel, Vincent Guittot On Mon, 02 Feb 2026 16:10:50 +0100, Vincent Guittot wrote: > No error return is missing after the loop resulting in removing the > ports from the list. > > Applied, thanks! [1/1] PCI: s32g: Fix ports parsing commit: b79e0875fe8144fcb09e4fc1cf386cb3b2262480 Best regards, -- Manivannan Sadhasivam <mani@kernel.org> ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-02-03 15:41 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-02-02 15:10 [PATCH v2] PCI: s32g: Fix ports parsing Vincent Guittot 2026-02-02 17:42 ` Frank Li 2026-02-02 19:23 ` Vincent Guittot 2026-02-02 19:46 ` Frank Li 2026-02-03 6:56 ` Vincent Guittot 2026-02-03 15:41 ` Frank Li 2026-02-03 12:57 ` Manivannan Sadhasivam
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox