From: Hans Zhang <18255117159@163.com>
To: bhelgaas@google.com, mani@kernel.org, lpieralisi@kernel.org,
kwilczynski@kernel.org, thierry.reding@kernel.org,
ryder.lee@mediatek.com, jonathanh@nvidia.com
Cc: robh@kernel.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
linux-tegra@vger.kernel.org, Hans Zhang <18255117159@163.com>
Subject: [PATCH v2 5/5] PCI: Make pcie_link_speed[] private to probe.c
Date: Sun, 8 Nov 2026 17:40:34 +0800 [thread overview]
Message-ID: <20261108094034.679945-6-18255117159@163.com> (raw)
In-Reply-To: <20261108094034.679945-1-18255117159@163.com>
pcie_get_link_speed() is now the only accessor for pcie_link_speed[].
Make the array static and remove its extern declaration and export so no
other code can index it directly.
Signed-off-by: Hans Zhang <18255117159@163.com>
---
drivers/pci/pci.h | 1 -
drivers/pci/probe.c | 3 +--
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 5441741bc330..04bdf3b86a56 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -118,7 +118,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 d0283a8158f2..f79b048f45a4 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -756,7 +756,7 @@ static const unsigned char pcix_bus_speed[] = {
};
/* Indexed by PCI_EXP_LNKCAP_SLS, PCI_EXP_LNKSTA_CLS */
-const unsigned char pcie_link_speed[] = {
+static const unsigned char pcie_link_speed[] = {
PCI_SPEED_UNKNOWN, /* 0 */
PCIE_SPEED_2_5GT, /* 1 */
PCIE_SPEED_5_0GT, /* 2 */
@@ -774,7 +774,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.43.0
prev parent reply other threads:[~2026-11-08 9:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-08 9:40 [PATCH v2 0/5] PCI: Encapsulate pcie_link_speed array access Hans Zhang
2026-11-08 9:40 ` [PATCH v2 1/5] PCI: Use pcie_get_link_speed() in pci.c Hans Zhang
2026-11-09 12:03 ` Ilpo Järvinen
2026-11-08 9:40 ` [PATCH v2 2/5] PCI: Convert remaining core pcie_link_speed[] users Hans Zhang
2026-11-08 9:40 ` [PATCH v2 3/5] PCI: tegra264: Use pcie_get_link_speed() Hans Zhang
2026-11-08 9:40 ` [PATCH v2 4/5] PCI: mediatek: " Hans Zhang
2026-11-08 9:40 ` Hans Zhang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261108094034.679945-6-18255117159@163.com \
--to=18255117159@163.com \
--cc=bhelgaas@google.com \
--cc=jonathanh@nvidia.com \
--cc=kwilczynski@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=robh@kernel.org \
--cc=ryder.lee@mediatek.com \
--cc=thierry.reding@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®