[PATCH net-next v1 1/1] treewide: Rename ERR_PTR_PCPU() --> PCPU_ERR_PTR()

From: Andy Shevchenko

Date: Thu Oct 30 2025 - 04:36:40 EST


Make the namespace of specific ERR_PTR() macro leading the thing.
This is already done for IOMEM_ERR_PTR(). Follow the same pattern
in PCPU_ERR_PTR().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---

I believe taking it via net-next makes most of sense, if no objections.

include/linux/err.h | 2 +-
kernel/events/hw_breakpoint.c | 4 ++--
net/netfilter/nf_tables_api.c | 6 +++---
3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/err.h b/include/linux/err.h
index 1d60aa86db53..8aafcf9492a4 100644
--- a/include/linux/err.h
+++ b/include/linux/err.h
@@ -42,7 +42,7 @@ static inline void * __must_check ERR_PTR(long error)
}

/* Return the pointer in the percpu address space. */
-#define ERR_PTR_PCPU(error) ((void __percpu *)(unsigned long)ERR_PTR(error))
+#define PCPU_ERR_PTR(error) ((void __percpu *)(unsigned long)ERR_PTR(error))

/* Cast an error pointer to __iomem. */
#define IOMEM_ERR_PTR(error) (__force void __iomem *)ERR_PTR(error)
diff --git a/kernel/events/hw_breakpoint.c b/kernel/events/hw_breakpoint.c
index 8ec2cb688903..67fc1367d649 100644
--- a/kernel/events/hw_breakpoint.c
+++ b/kernel/events/hw_breakpoint.c
@@ -849,7 +849,7 @@ register_wide_hw_breakpoint(struct perf_event_attr *attr,

cpu_events = alloc_percpu(typeof(*cpu_events));
if (!cpu_events)
- return ERR_PTR_PCPU(-ENOMEM);
+ return PCPU_ERR_PTR(-ENOMEM);

cpus_read_lock();
for_each_online_cpu(cpu) {
@@ -868,7 +868,7 @@ register_wide_hw_breakpoint(struct perf_event_attr *attr,
return cpu_events;

unregister_wide_hw_breakpoint(cpu_events);
- return ERR_PTR_PCPU(err);
+ return PCPU_ERR_PTR(err);
}
EXPORT_SYMBOL_GPL(register_wide_hw_breakpoint);

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index eed434e0a970..1b5286545a3c 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -2228,14 +2228,14 @@ static struct nft_stats __percpu *nft_stats_alloc(const struct nlattr *attr)
err = nla_parse_nested_deprecated(tb, NFTA_COUNTER_MAX, attr,
nft_counter_policy, NULL);
if (err < 0)
- return ERR_PTR_PCPU(err);
+ return PCPU_ERR_PTR(err);

if (!tb[NFTA_COUNTER_BYTES] || !tb[NFTA_COUNTER_PACKETS])
- return ERR_PTR_PCPU(-EINVAL);
+ return PCPU_ERR_PTR(-EINVAL);

newstats = netdev_alloc_pcpu_stats(struct nft_stats);
if (newstats == NULL)
- return ERR_PTR_PCPU(-ENOMEM);
+ return PCPU_ERR_PTR(-ENOMEM);

/* Restore old counters on this cpu, no problem. Per-cpu statistics
* are not exposed to userspace.
--
2.50.1