[PATCH 12/16] PCI/sysfs: Use sysfs_emit() for cpumask show callbacks

From: Yury Norov

Date: Thu May 28 2026 - 14:42:32 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>
---
drivers/pci/pci-sysfs.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index d37860841260..319c1d1459ac 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -114,7 +114,8 @@ static ssize_t pci_dev_show_local_cpu(struct device *dev, bool list,
#else
mask = cpumask_of_pcibus(to_pci_dev(dev)->bus);
#endif
- return cpumap_print_to_pagebuf(list, buf, mask);
+ return sysfs_emit(buf, list ? "%*pbl\n" : "%*pb\n",
+ cpumask_pr_args(mask));
}

static ssize_t local_cpus_show(struct device *dev,
@@ -139,7 +140,7 @@ static ssize_t cpuaffinity_show(struct device *dev,
{
const struct cpumask *cpumask = cpumask_of_pcibus(to_pci_bus(dev));

- return cpumap_print_to_pagebuf(false, buf, cpumask);
+ return sysfs_emit(buf, "%*pb\n", cpumask_pr_args(cpumask));
}
static DEVICE_ATTR_RO(cpuaffinity);

@@ -148,7 +149,7 @@ static ssize_t cpulistaffinity_show(struct device *dev,
{
const struct cpumask *cpumask = cpumask_of_pcibus(to_pci_bus(dev));

- return cpumap_print_to_pagebuf(true, buf, cpumask);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(cpumask));
}
static DEVICE_ATTR_RO(cpulistaffinity);

--
2.51.0