[PATCH v1 3/3] PCI: Remove extern declaration of pcie_link_speed array

From: Hans Zhang

Date: Sun Mar 15 2026 - 12:02:33 EST


With all users of pcie_link_speed converted to use to_pcie_link_speed(),
the external declaration in pci.h is no longer needed. Remove it to
prevent new code from directly accessing the array and to reduce the
global symbol footprint.

Signed-off-by: Hans Zhang <18255117159@xxxxxxx>
---
drivers/pci/pci.h | 1 -
drivers/pci/probe.c | 1 -
2 files changed, 2 deletions(-)

diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 053fc245a1e3..b2f91409b439 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -107,7 +107,6 @@ struct pcie_tlp_log;
#define PCI_EXP_AER_FLAGS (PCI_EXP_DEVCTL_CERE | PCI_EXP_DEVCTL_NFERE | \
PCI_EXP_DEVCTL_FERE | PCI_EXP_DEVCTL_URRE)

-extern const unsigned char pcie_link_speed[];
unsigned char pcie_get_link_speed(unsigned int speed);

extern bool pci_early_dump;
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 40f2185ac3b5..0c93eff80b71 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -781,7 +781,6 @@ const unsigned char pcie_link_speed[] = {
PCI_SPEED_UNKNOWN, /* E */
PCI_SPEED_UNKNOWN /* F */
};
-EXPORT_SYMBOL_GPL(pcie_link_speed);

/**
* pcie_get_link_speed - Get speed value from PCIe generation number
--
2.34.1