Re: [PATCH v2 03/11] PCI: Change pci_dev variable from 'bridge' to 'dev'

From: Alex Bennée

Date: Fri Nov 14 2025 - 09:35:12 EST


Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx> writes:

> Upcoming fix to BAR resize will store also device BAR resource in the
> saved list. Change the pci_dev variable in the loop from 'bridge' to
> 'dev' as the former would be misleading with non-bridges in the list.
>
> This is in a separate change to reduce churn in the upcoming BAR resize
> fix.
>
> While it appears that the logic in the loop doing pci_setup_bridge() is
> altered as 'bridge' variable is no longer updated, a bridge should
> never appear more than once in the saved list so the if check can only
> match to the first entry. As such, the code with two distinct pci_dev
> variables better represents the intention of the check compared with the
> old code where bridge variable was reused for a different purpose.
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>

Reviewed-by: Alex Bennée <alex.bennee@xxxxxxxxxx>

--
Alex Bennée
Virtualisation Tech Lead @ Linaro