* [PATCH] PCI: Use %pe format specifier to print error pointers
@ 2026-07-20 21:08 Krzysztof Wilczyński
2026-07-20 21:10 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Wilczyński @ 2026-07-20 21:08 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Bjorn Helgaas, Manivannan Sadhasivam, Lorenzo Pieralisi,
Rafael J . Wysocki, Rob Herring, linux-pci
Currently, several files in the PCI tree print error pointers using
the %ld format specifier together with an explicit PTR_ERR()
conversion, which prints the numeric errno value.
Thus, at every affected call site, use the %pe format specifier, which
exists specifically to print error pointers, and pass the error pointer
directly. With CONFIG_SYMBOLIC_ERRNAME enabled, this prints a symbolic
error name such as -ENOMEM, falling back to the numeric errno value
otherwise. As such, the explicit PTR_ERR() conversion is no longer
needed.
No functional changes intended.
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
---
drivers/pci/controller/dwc/pci-meson.c | 2 +-
drivers/pci/controller/dwc/pcie-tegra194.c | 16 ++++++++--------
drivers/pci/controller/pci-aardvark.c | 2 +-
drivers/pci/controller/pci-tegra.c | 3 +--
drivers/pci/controller/pcie-rockchip.c | 4 ++--
drivers/pci/doe.c | 4 ++--
drivers/pci/pci-acpi.c | 4 ++--
7 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c
index 225d887cd0a3..125229ca7d7c 100644
--- a/drivers/pci/controller/dwc/pci-meson.c
+++ b/drivers/pci/controller/dwc/pci-meson.c
@@ -398,7 +398,7 @@ static int meson_pcie_probe(struct platform_device *pdev)
mp->phy = devm_phy_get(dev, "pcie");
if (IS_ERR(mp->phy)) {
- dev_err(dev, "get phy failed, %ld\n", PTR_ERR(mp->phy));
+ dev_err(dev, "get phy failed, %pe\n", mp->phy);
return PTR_ERR(mp->phy);
}
diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
index 795cef5a915d..63a0f56cad8e 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -2196,15 +2196,15 @@ static int tegra_pcie_dw_probe(struct platform_device *pdev)
if (IS_ERR(pcie->pex_ctl_supply)) {
ret = PTR_ERR(pcie->pex_ctl_supply);
if (ret != -EPROBE_DEFER)
- dev_err(dev, "Failed to get regulator: %ld\n",
- PTR_ERR(pcie->pex_ctl_supply));
+ dev_err(dev, "Failed to get regulator: %pe\n",
+ pcie->pex_ctl_supply);
return ret;
}
pcie->core_clk = devm_clk_get(dev, "core");
if (IS_ERR(pcie->core_clk)) {
- dev_err(dev, "Failed to get core clock: %ld\n",
- PTR_ERR(pcie->core_clk));
+ dev_err(dev, "Failed to get core clock: %pe\n",
+ pcie->core_clk);
return PTR_ERR(pcie->core_clk);
}
@@ -2226,8 +2226,8 @@ static int tegra_pcie_dw_probe(struct platform_device *pdev)
pcie->core_apb_rst = devm_reset_control_get(dev, "apb");
if (IS_ERR(pcie->core_apb_rst)) {
- dev_err(dev, "Failed to get APB reset: %ld\n",
- PTR_ERR(pcie->core_apb_rst));
+ dev_err(dev, "Failed to get APB reset: %pe\n",
+ pcie->core_apb_rst);
return PTR_ERR(pcie->core_apb_rst);
}
@@ -2268,8 +2268,8 @@ static int tegra_pcie_dw_probe(struct platform_device *pdev)
pcie->core_rst = devm_reset_control_get(dev, "core");
if (IS_ERR(pcie->core_rst)) {
- dev_err(dev, "Failed to get core reset: %ld\n",
- PTR_ERR(pcie->core_rst));
+ dev_err(dev, "Failed to get core reset: %pe\n",
+ pcie->core_rst);
return PTR_ERR(pcie->core_rst);
}
diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c
index fd9c7d53e8a7..f2bbfb0f20c9 100644
--- a/drivers/pci/controller/pci-aardvark.c
+++ b/drivers/pci/controller/pci-aardvark.c
@@ -1722,7 +1722,7 @@ static int advk_pcie_setup_phy(struct advk_pcie *pcie)
/* Old bindings miss the PHY handle */
if (IS_ERR(pcie->phy)) {
- dev_warn(dev, "PHY unavailable (%ld)\n", PTR_ERR(pcie->phy));
+ dev_warn(dev, "PHY unavailable (%pe)\n", pcie->phy);
pcie->phy = NULL;
return 0;
}
diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pci-tegra.c
index 229c69534476..59b56446c507 100644
--- a/drivers/pci/controller/pci-tegra.c
+++ b/drivers/pci/controller/pci-tegra.c
@@ -1356,8 +1356,7 @@ static int tegra_pcie_port_get_phys(struct tegra_pcie_port *port)
for (i = 0; i < port->lanes; i++) {
phy = devm_of_phy_optional_get_index(dev, port->np, "pcie", i);
if (IS_ERR(phy)) {
- dev_err(dev, "failed to get PHY#%u: %ld\n", i,
- PTR_ERR(phy));
+ dev_err(dev, "failed to get PHY#%u: %pe\n", i, phy);
return PTR_ERR(phy);
}
diff --git a/drivers/pci/controller/pcie-rockchip.c b/drivers/pci/controller/pcie-rockchip.c
index 0f88da378805..8d78ab1b31f0 100644
--- a/drivers/pci/controller/pcie-rockchip.c
+++ b/drivers/pci/controller/pcie-rockchip.c
@@ -232,8 +232,8 @@ int rockchip_pcie_get_phys(struct rockchip_pcie *rockchip)
if (IS_ERR(phy)) {
if (PTR_ERR(phy) != -EPROBE_DEFER)
- dev_err(dev, "missing phy for lane %d: %ld\n",
- i, PTR_ERR(phy));
+ dev_err(dev, "missing phy for lane %d: %pe\n",
+ i, phy);
return PTR_ERR(phy);
}
diff --git a/drivers/pci/doe.c b/drivers/pci/doe.c
index 7b41da4ec11a..ac95b1d2d999 100644
--- a/drivers/pci/doe.c
+++ b/drivers/pci/doe.c
@@ -858,8 +858,8 @@ void pci_doe_init(struct pci_dev *pdev)
PCI_EXT_CAP_ID_DOE))) {
doe_mb = pci_doe_create_mb(pdev, offset);
if (IS_ERR(doe_mb)) {
- pci_err(pdev, "[%x] failed to create mailbox: %ld\n",
- offset, PTR_ERR(doe_mb));
+ pci_err(pdev, "[%x] failed to create mailbox: %pe\n",
+ offset, doe_mb);
continue;
}
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index 4d0f2cb6c695..42d545edd7fa 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -1636,8 +1636,8 @@ pci_acpi_setup_ecam_mapping(struct acpi_pci_root *root)
cfg = pci_ecam_create(dev, &cfgres, bus_res, ecam_ops);
if (IS_ERR(cfg)) {
- dev_err(dev, "%04x:%pR error %ld mapping ECAM\n", seg, bus_res,
- PTR_ERR(cfg));
+ dev_err(dev, "%04x:%pR error %pe mapping ECAM\n", seg, bus_res,
+ cfg);
return NULL;
}
--
2.55.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] PCI: Use %pe format specifier to print error pointers
2026-07-20 21:08 [PATCH] PCI: Use %pe format specifier to print error pointers Krzysztof Wilczyński
@ 2026-07-20 21:10 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-07-20 21:10 UTC (permalink / raw)
To: Krzysztof Wilczyński; +Cc: linux-pci
> Currently, several files in the PCI tree print error pointers using
> the %ld format specifier together with an explicit PTR_ERR()
> conversion, which prints the numeric errno value.
>
> Thus, at every affected call site, use the %pe format specifier, which
> exists specifically to print error pointers, and pass the error pointer
> directly. With CONFIG_SYMBOLIC_ERRNAME enabled, this prints a symbolic
> error name such as -ENOMEM, falling back to the numeric errno value
> otherwise. As such, the explicit PTR_ERR() conversion is no longer
> needed.
>
> No functional changes intended.
>
> Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260720210839.1507406-1-kwilczynski@kernel.org?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-20 21:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-20 21:08 [PATCH] PCI: Use %pe format specifier to print error pointers Krzysztof Wilczyński
2026-07-20 21:10 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox