Commit f9a6c8ad authored by Lukas Wunner's avatar Lukas Wunner Committed by Bjorn Helgaas

PCI/ERR: Reduce compile time for CONFIG_PCIEAER=n

The sole non-static function in err.c, pcie_do_recovery(), is only
called from:

* aer.c (if CONFIG_PCIEAER=y)
* dpc.c (if CONFIG_PCIE_DPC=y, which depends on CONFIG_PCIEAER)
* edr.c (if CONFIG_PCIE_EDR=y, which depends on CONFIG_PCIE_DPC)

Thus, err.c need not be compiled if CONFIG_PCIEAER=n.

Also, pci_uevent_ers() and pcie_clear_device_status(), which are called
from err.c, can be #ifdef'ed away unless CONFIG_PCIEAER=y.

Since x86_64_defconfig doesn't enable CONFIG_PCIEAER, this change may
slightly reduce compile time for anyone doing a test build with that
config.

Link: https://lore.kernel.org/r/98f9041151268c1c035ab64cca320ad86803f64a.1627638184.git.lukas@wunner.deSigned-off-by: default avatarLukas Wunner <lukas@wunner.de>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent bb6951b8
...@@ -1542,7 +1542,7 @@ static int pci_uevent(struct device *dev, struct kobj_uevent_env *env) ...@@ -1542,7 +1542,7 @@ static int pci_uevent(struct device *dev, struct kobj_uevent_env *env)
return 0; return 0;
} }
#if defined(CONFIG_PCIEPORTBUS) || defined(CONFIG_EEH) #if defined(CONFIG_PCIEAER) || defined(CONFIG_EEH)
/** /**
* pci_uevent_ers - emit a uevent during recovery path of PCI device * pci_uevent_ers - emit a uevent during recovery path of PCI device
* @pdev: PCI device undergoing error recovery * @pdev: PCI device undergoing error recovery
......
...@@ -2218,6 +2218,7 @@ int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state) ...@@ -2218,6 +2218,7 @@ int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state)
} }
EXPORT_SYMBOL_GPL(pci_set_pcie_reset_state); EXPORT_SYMBOL_GPL(pci_set_pcie_reset_state);
#ifdef CONFIG_PCIEAER
void pcie_clear_device_status(struct pci_dev *dev) void pcie_clear_device_status(struct pci_dev *dev)
{ {
u16 sta; u16 sta;
...@@ -2225,6 +2226,7 @@ void pcie_clear_device_status(struct pci_dev *dev) ...@@ -2225,6 +2226,7 @@ void pcie_clear_device_status(struct pci_dev *dev)
pcie_capability_read_word(dev, PCI_EXP_DEVSTA, &sta); pcie_capability_read_word(dev, PCI_EXP_DEVSTA, &sta);
pcie_capability_write_word(dev, PCI_EXP_DEVSTA, sta); pcie_capability_write_word(dev, PCI_EXP_DEVSTA, sta);
} }
#endif
/** /**
* pcie_clear_root_pme_status - Clear root port PME interrupt status. * pcie_clear_root_pme_status - Clear root port PME interrupt status.
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
# #
# Makefile for PCI Express features and port driver # Makefile for PCI Express features and port driver
pcieportdrv-y := portdrv_core.o portdrv_pci.o err.o rcec.o pcieportdrv-y := portdrv_core.o portdrv_pci.o rcec.o
obj-$(CONFIG_PCIEPORTBUS) += pcieportdrv.o obj-$(CONFIG_PCIEPORTBUS) += pcieportdrv.o
obj-$(CONFIG_PCIEASPM) += aspm.o obj-$(CONFIG_PCIEASPM) += aspm.o
obj-$(CONFIG_PCIEAER) += aer.o obj-$(CONFIG_PCIEAER) += aer.o err.o
obj-$(CONFIG_PCIEAER_INJECT) += aer_inject.o obj-$(CONFIG_PCIEAER_INJECT) += aer_inject.o
obj-$(CONFIG_PCIE_PME) += pme.o obj-$(CONFIG_PCIE_PME) += pme.o
obj-$(CONFIG_PCIE_DPC) += dpc.o obj-$(CONFIG_PCIE_DPC) += dpc.o
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment