public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH next V2] PCI: brmstb: Fix type mismatch for num_inbound_wins in brcm_pcie_get_inbound_wins
@ 2024-09-07 16:09 Riyan Dhiman
  2024-09-07 16:46 ` Krzysztof Wilczyński
  0 siblings, 1 reply; 3+ messages in thread
From: Riyan Dhiman @ 2024-09-07 16:09 UTC (permalink / raw)
  To: jim2101024, nsaenz, lorian.fainelli, bcm-kernel-feedback-list,
	bhelgaas
  Cc: linux-pci, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
	Riyan Dhiman

Change num_inbound_wins from u8 to int to correctly handle
potential negative error codes returned by brcm_pcie_get_inbound_wins().
The u8 type was inappropriate for capturing the function's return value,
which can include error codes.

Signed-off-by: Riyan Dhiman <riyandhiman14@gmail.com>
---
V2: Added missing semicolon in variable declaration

 drivers/pci/controller/pcie-brcmstb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
index e8332fe5396e..b2859c4fd931 100644
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -1030,7 +1030,8 @@ static int brcm_pcie_setup(struct brcm_pcie *pcie)
 	struct pci_host_bridge *bridge;
 	struct resource_entry *entry;
 	u32 tmp, burst, aspm_support;
-	u8 num_out_wins = 0, num_inbound_wins = 0;
+	u8 num_out_wins = 0;
+	int num_inbound_wins = 0;
 	int memc, ret;
 
 	/* Reset the bridge */
-- 
2.46.0



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

* Re: [PATCH next V2] PCI: brmstb: Fix type mismatch for num_inbound_wins in brcm_pcie_get_inbound_wins
  2024-09-07 16:09 [PATCH next V2] PCI: brmstb: Fix type mismatch for num_inbound_wins in brcm_pcie_get_inbound_wins Riyan Dhiman
@ 2024-09-07 16:46 ` Krzysztof Wilczyński
  2024-09-07 16:56   ` Krzysztof Wilczyński
  0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Wilczyński @ 2024-09-07 16:46 UTC (permalink / raw)
  To: Riyan Dhiman
  Cc: jim2101024, nsaenz, lorian.fainelli, bcm-kernel-feedback-list,
	bhelgaas, linux-pci, linux-rpi-kernel, linux-arm-kernel,
	linux-kernel

Hello,

> Change num_inbound_wins from u8 to int to correctly handle
> potential negative error codes returned by brcm_pcie_get_inbound_wins().
> The u8 type was inappropriate for capturing the function's return value,
> which can include error codes.

I squashed with the current code on the controller/brcmstb branch, see:

  - https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/commit/?h=controller/brcmstb&id=ae6476c6de187bea90c729e3e0188143300fa671

And credited you via the Co-developed-by tag such that you get credit for
fixing this issue.  Thank you, by the way.

There is no Fixes: tag as this code is not yet merged into the mainline.

	Krzysztof


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

* Re: [PATCH next V2] PCI: brmstb: Fix type mismatch for num_inbound_wins in brcm_pcie_get_inbound_wins
  2024-09-07 16:46 ` Krzysztof Wilczyński
@ 2024-09-07 16:56   ` Krzysztof Wilczyński
  0 siblings, 0 replies; 3+ messages in thread
From: Krzysztof Wilczyński @ 2024-09-07 16:56 UTC (permalink / raw)
  To: Riyan Dhiman
  Cc: jim2101024, nsaenz, florian.fainelli, bcm-kernel-feedback-list,
	bhelgaas, linux-pci, linux-rpi-kernel, linux-arm-kernel,
	linux-kernel

Hello,

> > Change num_inbound_wins from u8 to int to correctly handle
> > potential negative error codes returned by brcm_pcie_get_inbound_wins().
> > The u8 type was inappropriate for capturing the function's return value,
> > which can include error codes.
> 
> I squashed with the current code on the controller/brcmstb branch, see:
> 
>   - https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/commit/?h=controller/brcmstb&id=ae6476c6de187bea90c729e3e0188143300fa671
> 
> And credited you via the Co-developed-by tag such that you get credit for
> fixing this issue.  Thank you, by the way.
> 
> There is no Fixes: tag as this code is not yet merged into the mainline.

For the record, I would prefer if we went with Florian's first
recommendation per the following message:

  - https://lore.kernel.org/linux-pci/159c5fcf-709d-42ba-8d45-a70b109fe261@broadcom.com

To clearly separate errors returned from the value being updated.

Albeit, this is fine too, especially as Jim expressed no opinion either
way regarding his preference.

	Krzysztof


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

end of thread, other threads:[~2024-09-07 16:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-07 16:09 [PATCH next V2] PCI: brmstb: Fix type mismatch for num_inbound_wins in brcm_pcie_get_inbound_wins Riyan Dhiman
2024-09-07 16:46 ` Krzysztof Wilczyński
2024-09-07 16:56   ` Krzysztof Wilczyński

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox