Thread (16 messages) 16 messages, 3 authors, 45m ago

Re: [PATCH v2 01/11] arm: Use sysfs_emit() for cpumask show callbacks

From: Yury Norov <hidden>
Date: 2026-07-02 16:06:00
Also in: driver-core, imx, linux-amlogic, linux-arm-msm, linux-cxl, linux-fpga, linux-pci, linux-perf-users, linux-pm, linux-rdma, lkml

On Thu, Jul 02, 2026 at 05:58:11PM +0200, Greg Kroah-Hartman wrote:
On Thu, Jul 02, 2026 at 11:47:14AM -0400, Yury Norov wrote:
quoted
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 <redacted>
---
 arch/arm/mach-imx/mmdc.c     | 2 +-
 arch/arm/mm/cache-l2x0-pmu.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c
index b71467c48b87..f6d993b9b1d4 100644
--- a/arch/arm/mach-imx/mmdc.c
+++ b/arch/arm/mach-imx/mmdc.c
@@ -127,7 +127,7 @@ static ssize_t mmdc_pmu_cpumask_show(struct device *dev,
 {
 	struct mmdc_pmu *pmu_mmdc = dev_get_drvdata(dev);
 
-	return cpumap_print_to_pagebuf(true, buf, &pmu_mmdc->cpu);
+	return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(&pmu_mmdc->cpu));
Really?  Looks like the original is much simpler to understand, why must
this function go away?
Because it's a duplicate of printk("*pbl"), and nothing is simpler in
practice.

Because the 'true' vs 'false' parameter in cpumap_print_to_pagebuf() is much
harder to remember, comparing to "*pbl" vs "*pb" in the standard printk-like
API. And because the 'print_to_pagebuf' has a record of misuse.

For more details, see:

https://lore.kernel.org/all/akANJ-AT7nHpRMq-@yury/ (local)

Thanks,
Yury
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help