[PATCH next] PCI: brmstb: Fix type mismatch for num_inbound_wins in brcm_pcie_setup()

florian.fainelli at broadcom.com florian.fainelli at broadcom.com
Wed Sep 4 09:55:48 PDT 2024


On 9/4/24 09:19, Riyan Dhiman wrote:
> Change num_inbound_wins from u8 to int in brcm_pcie_setup() function 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 at gmail.com>

This looks fine, however it seems like we could either:

- update brcm_pcie_get_inbound_wins() to take a reference to an u8 and 
assign num_inbound_wins directly plus return a negative error code

or

- update brcm_pcie_get_inbound_wins() to return 0 when encountering an error

We should have at least 1 inbound window to operate this PCIe 
controller, so if we get 0, nothing useful is going to happen.

Deferring to Jim as to whether he prefers to take your patch or fix it 
in a different way. Thanks!
-- 
Florian



More information about the linux-arm-kernel mailing list