PCI: brmstb: Fix type mismatch for num_inbound_wins in brcm_pcie_get_inbound_wins
Subsystems (5)
PATCH v2 1/1 PCI: brmstb: Fix type mismatch for num_inbound_wins in brcm_pcie_get_inbound_wins
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.
---
V2: Added missing semicolon in variable declaration
drivers/pci/controller/pcie-brcmstb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pci/controller/pcie-brcmstb.c +2 -1
@@ -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 */
Signature · 1 line
2.46.0
Hello,
Quoted 4 lines
Change
num_inbound_winsfrom u8 to int to correctly handle potential negative error codes returned bybrcm_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:
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
Hello,
Quoted 5 lines
Quoted 4 lines
Change
num_inbound_winsfrom u8 to int to correctly handle potential negative error codes returned bybrcm_pcie_get_inbound_wins(). The u8 type was inappropriate for capturing the function's return value, which can include error codes.
Quoted 8 lines
I squashed with the current code on the controller/brcmstb branch, see:
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/[email protected]
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