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:
> > 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 <[email protected]>
> > ---
> >  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/

Thanks,
Yury

Reply via email to