Re: [PATCH] pci: dead code cleanup in Kconfig

From: Bjorn Helgaas

Date: Tue Mar 31 2026 - 15:22:01 EST


On Mon, Mar 30, 2026 at 10:45:49PM +0100, Julian Braha wrote:
> There is already an 'if PCI' condition wrapping several config options
> e.g. PCI_DOMAINS and VGA_ARB, making the 'depends on PCI' statement for
> each of these a duplicate dependency (dead code).
>
> I propose leaving the outer 'if PCI...endif' and removing the individual
> 'depends on PCI' statement from each option.
>
> This dead code was found by kconfirm, a static analysis tool for Kconfig.
>
> Signed-off-by: Julian Braha <julianbraha@xxxxxxxxx>
> ---
> drivers/pci/Kconfig | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)

I think there might be more redundant dependencies, e.g.,

- HOTPLUG_PCI in drivers/pci/hotplug/Kconfig depends on PCI but this
file is only included 'if PCI'

- there are several "depends on PCI" things in
drivers/pci/controller/Kconfig
drivers/pci/controller/cadence/Kconfig
drivers/pci/controller/dwc/Kconfig
drivers/pci/controller/plda/Kconfig
drivers/pci/switch/Kconfig
I think all these are only included 'if PCI'