[PATCH 1/3] powerpc/cacheinfo: Use cpumap_print to print cpumap

Tejun Heo tj at kernel.org
Mon Jun 29 23:26:38 AEST 2020


On Mon, Jun 29, 2020 at 04:07:01PM +0530, Srikar Dronamraju wrote:
> Tejun Heo had modified shared_cpu_map_show to use scnprintf instead of
> cpumap_print during support for *pb[l] format.
> Refer commit 0c118b7bd09a ("powerpc: use %*pb[l] to print bitmaps including
> cpumasks and nodemasks")
> 
> cpumap_print_to_pagebuf is a standard function to print cpumap.  With
> commit 9cf79d115f0d ("bitmap: remove explicit newline handling using
> scnprintf format string"), there is no need to print explicit newline and
> trailing null character. cpumap_print_to_pagebuf internally uses
> scnprintf. Hence replace scnprintf with cpumap_print_to_pagebuf.
> 
> Note: shared_cpu_map_show in drivers/base/cacheinfo.c already uses
> cpumap_print_to_pagebuf.
> 
> Before this patch
> # cat /sys/devices/system/cpu0/cache/index1/shared_cpu_map
> 00ff
> 
> #
> 		(Notice the extra blank line).
> 
> After this patch
> # cat /sys/devices/system/cpu0/cache/index1/shared_cpu_map
> 00ff
> #
> 
> Cc: Nathan Lynch <nathanl at linux.ibm.com>
> Cc: Tejun Heo <tj at kernel.org>
> Cc: Michael Ellerman <mpe at ellerman.id.au>
> Cc: linuxppc-dev at lists.ozlabs.org
> Signed-off-by: Srikar Dronamraju <srikar at linux.vnet.ibm.com>

Acked-by: Tejun Heo <tj at kernel.org>

Thanks.

-- 
tejun


More information about the Linuxppc-dev mailing list