[PATCH 04/16] x86/events: Use sysfs_emit() for cpumask show callbacks
From: Yury Norov
Date: Thu May 28 2026 - 14:39:11 EST
These callbacks are sysfs show paths.
Use sysfs_emit() and cpumask_pr_args() to emit the masks.
This prepares for removing cpumap_print_to_pagebuf().
Signed-off-by: Yury Norov <ynorov@xxxxxxxxxx>
---
arch/x86/events/amd/iommu.c | 2 +-
arch/x86/events/amd/power.c | 2 +-
arch/x86/events/amd/uncore.c | 2 +-
arch/x86/events/intel/core.c | 2 +-
arch/x86/events/intel/uncore.c | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/x86/events/amd/iommu.c b/arch/x86/events/amd/iommu.c
index 07b110e8418a..f332c7089bd5 100644
--- a/arch/x86/events/amd/iommu.c
+++ b/arch/x86/events/amd/iommu.c
@@ -137,7 +137,7 @@ static ssize_t _iommu_cpumask_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- return cpumap_print_to_pagebuf(true, buf, &iommu_cpumask);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(&iommu_cpumask));
}
static DEVICE_ATTR(cpumask, S_IRUGO, _iommu_cpumask_show, NULL);
diff --git a/arch/x86/events/amd/power.c b/arch/x86/events/amd/power.c
index dad42790cf7d..890609961a6f 100644
--- a/arch/x86/events/amd/power.c
+++ b/arch/x86/events/amd/power.c
@@ -147,7 +147,7 @@ static void pmu_event_read(struct perf_event *event)
static ssize_t
get_attr_cpumask(struct device *dev, struct device_attribute *attr, char *buf)
{
- return cpumap_print_to_pagebuf(true, buf, &cpu_mask);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(&cpu_mask));
}
static DEVICE_ATTR(cpumask, S_IRUGO, get_attr_cpumask, NULL);
diff --git a/arch/x86/events/amd/uncore.c b/arch/x86/events/amd/uncore.c
index dd956cfcadef..797dcce8bd89 100644
--- a/arch/x86/events/amd/uncore.c
+++ b/arch/x86/events/amd/uncore.c
@@ -321,7 +321,7 @@ static ssize_t amd_uncore_attr_show_cpumask(struct device *dev,
struct pmu *ptr = dev_get_drvdata(dev);
struct amd_uncore_pmu *pmu = container_of(ptr, struct amd_uncore_pmu, pmu);
- return cpumap_print_to_pagebuf(true, buf, &pmu->active_mask);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(&pmu->active_mask));
}
static DEVICE_ATTR(cpumask, S_IRUGO, amd_uncore_attr_show_cpumask, NULL);
diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
index dd1e3aa75ee9..5e9b65b2d1c1 100644
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -7311,7 +7311,7 @@ static ssize_t intel_hybrid_get_attr_cpus(struct device *dev,
struct x86_hybrid_pmu *pmu =
container_of(dev_get_drvdata(dev), struct x86_hybrid_pmu, pmu);
- return cpumap_print_to_pagebuf(true, buf, &pmu->supported_cpus);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(&pmu->supported_cpus));
}
static DEVICE_ATTR(cpus, S_IRUGO, intel_hybrid_get_attr_cpus, NULL);
diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c
index e9cc1ba921c5..746d0d526f1d 100644
--- a/arch/x86/events/intel/uncore.c
+++ b/arch/x86/events/intel/uncore.c
@@ -842,7 +842,7 @@ static ssize_t uncore_get_attr_cpumask(struct device *dev,
{
struct intel_uncore_pmu *pmu = container_of(dev_get_drvdata(dev), struct intel_uncore_pmu, pmu);
- return cpumap_print_to_pagebuf(true, buf, &pmu->cpu_mask);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(&pmu->cpu_mask));
}
static DEVICE_ATTR(cpumask, S_IRUGO, uncore_get_attr_cpumask, NULL);
--
2.51.0