From: Yury Norov <ynorov@nvidia.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Yury Norov <ynorov@nvidia.com>
Cc: "Russell King" <linux@armlinux.org.uk>,
"Frank Li" <Frank.Li@nxp.com>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Pengutronix Kernel Team" <kernel@pengutronix.de>,
"Fabio Estevam" <festevam@gmail.com>,
"Madhavan Srinivasan" <maddy@linux.ibm.com>,
"Michael Ellerman" <mpe@ellerman.id.au>,
"Nicholas Piggin" <npiggin@gmail.com>,
"Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
"Peter Zijlstra" <peterz@infradead.org>,
"Ingo Molnar" <mingo@redhat.com>,
"Arnaldo Carvalho de Melo" <acme@kernel.org>,
"Namhyung Kim" <namhyung@kernel.org>,
"Mark Rutland" <mark.rutland@arm.com>,
"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
"Jiri Olsa" <jolsa@kernel.org>, "Ian Rogers" <irogers@google.com>,
"Adrian Hunter" <adrian.hunter@intel.com>,
"James Clark" <james.clark@linaro.org>,
"Thomas Gleixner" <tglx@kernel.org>,
"Borislav Petkov" <bp@alien8.de>,
"Dave Hansen" <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Danilo Krummrich" <dakr@kernel.org>,
"Chanwoo Choi" <cw00.choi@samsung.com>,
"MyungJoo Ham" <myungjoo.ham@samsung.com>,
"Kyungmin Park" <kyungmin.park@samsung.com>,
"Heiko Stuebner" <heiko@sntech.de>,
"Xu Yilun" <yilun.xu@intel.com>, "Tom Rix" <trix@redhat.com>,
"Moritz Fischer" <mdf@kernel.org>,
"Yicong Yang" <yangyicong@hisilicon.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"Dennis Dalessandro" <dennis.dalessandro@cornelisnetworks.com>,
"Jason Gunthorpe" <jgg@ziepe.ca>,
"Leon Romanovsky" <leon@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Shuai Xue" <xueshuai@linux.alibaba.com>,
"Will Deacon" <will@kernel.org>,
"Jiucheng Xu" <jiucheng.xu@amlogic.com>,
"Neil Armstrong" <neil.armstrong@linaro.org>,
"Kevin Hilman" <khilman@baylibre.com>,
"Jerome Brunet" <jbrunet@baylibre.com>,
"Martin Blumenstingl" <martin.blumenstingl@googlemail.com>,
"Robin Murphy" <robin.murphy@arm.com>,
"Jing Zhang" <renyu.zj@linux.alibaba.com>,
"Xu Yang" <xu.yang_2@nxp.com>,
"Linu Cherian" <lcherian@marvell.com>,
"Gowthami Thiagarajan" <gthiagarajan@marvell.com>,
"Ji Sheng Teoh" <jisheng.teoh@starfivetech.com>,
"Khuong Dinh" <khuong@os.amperecomputing.com>,
"Yury Norov" <yury.norov@gmail.com>,
"Kees Cook" <kees@kernel.org>,
"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
"Aboorva Devarajan" <aboorvad@linux.ibm.com>,
"Ilkka Koskinen" <ilkka@os.amperecomputing.com>,
"Besar Wicaksono" <bwicaksono@nvidia.com>,
"Ma Ke" <make24@iscas.ac.cn>,
"Chengwen Feng" <fengchengwen@huawei.com>,
"Ritesh Harjani" <ritesh.list@gmail.com>,
"Yushan Wang" <wangyushan12@huawei.com>,
linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-perf-users@vger.kernel.org, x86@kernel.org,
driver-core@lists.linux.dev, linux-pm@vger.kernel.org,
linux-rockchip@lists.infradead.org, linux-fpga@vger.kernel.org,
linux-rdma@vger.kernel.org, linux-pci@vger.kernel.org,
linux-amlogic@lists.infradead.org, linux-cxl@vger.kernel.org,
linux-arm-msm@vger.kernel.org
Subject: [PATCH v2 11/11] lib/bitmap-str: get rid of cpumap_print_to_pagebuf()
Date: Thu, 2 Jul 2026 11:47:24 -0400 [thread overview]
Message-ID: <20260702154725.185376-12-ynorov@nvidia.com> (raw)
In-Reply-To: <20260702154725.185376-1-ynorov@nvidia.com>
Now that all users of the function are switched to the alternatives,
drop the function.
Signed-off-by: Yury Norov <ynorov@nvidia.com>
---
include/linux/cpumask.h | 19 -------------------
lib/bitmap-str.c | 9 ++++-----
2 files changed, 4 insertions(+), 24 deletions(-)
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index d3cda0544954..4c8bb6953107 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -13,7 +13,6 @@
#include <linux/cpumask_types.h>
#include <linux/gfp_types.h>
#include <linux/numa.h>
-#include <linux/sprintf.h>
#include <linux/threads.h>
#include <linux/types.h>
#include <vdso/page.h>
@@ -1315,24 +1314,6 @@ static __always_inline bool cpu_dying(unsigned int cpu)
}
#endif /* NR_CPUS > BITS_PER_LONG */
-/**
- * cpumap_print_to_pagebuf - copies the cpumask into the buffer either
- * as comma-separated list of cpus or hex values of cpumask
- * @list: indicates whether the cpumap must be list
- * @mask: the cpumask to copy
- * @buf: the buffer to copy into
- *
- * Return: the length of the (null-terminated) @buf string, zero if
- * nothing is copied.
- */
-static __always_inline ssize_t
-cpumap_print_to_pagebuf(bool list, char *buf, const struct cpumask *mask)
-{
- /* Opencode offset_in_page(buf) to not include linux/mm.h */
- return scnprintf(buf, PAGE_SIZE - ((unsigned long)buf & ~PAGE_MASK),
- list ? "%*pbl\n" : "%*pb\n", cpumask_pr_args(mask));
-}
-
/**
* cpumap_print_bitmask_to_buf - copies the cpumask into the buffer as
* hex values of cpumask
diff --git a/lib/bitmap-str.c b/lib/bitmap-str.c
index 26d36c938c6a..dd9aa0635fa5 100644
--- a/lib/bitmap-str.c
+++ b/lib/bitmap-str.c
@@ -75,8 +75,7 @@ static int bitmap_print_to_buf(bool list, char *buf, const unsigned long *maskp,
* @off: in the string from which we are copying, We copy to @buf
* @count: the maximum number of bytes to print
*
- * The sprintf("%*pb[l]") is used indirectly via its cpumap wrapper
- * cpumap_print_to_pagebuf() or directly by drivers to export hexadecimal
+ * The sprintf("%*pb[l]") format is used by drivers to export hexadecimal
* bitmask and decimal list to userspace by sysfs ABI.
* Drivers might be using a normal attribute for this kind of ABIs. A
* normal attribute typically has show entry as below::
@@ -115,9 +114,9 @@ static int bitmap_print_to_buf(bool list, char *buf, const unsigned long *maskp,
* parameters such as off, count from bin_attribute show entry to this API.
*
* The role of cpumap_print_bitmask_to_buf() and cpumap_print_list_to_buf()
- * is similar with cpumap_print_to_pagebuf(), the difference is that
- * scnprintf("%*pb[l]") mainly serves sysfs attribute with the assumption
- * the destination buffer is exactly one page and won't be more than one page.
+ * is similar to direct sysfs_emit("%*pb[l]") formatting, but the latter
+ * assumes the destination buffer is exactly one page and won't be more than
+ * one page.
* cpumap_print_bitmask_to_buf() and cpumap_print_list_to_buf(), on the other
* hand, mainly serves bin_attribute which doesn't work with exact one page,
* and it can break the size limit of converted decimal list and hexadecimal
--
2.53.0
prev parent reply other threads:[~2026-07-02 15:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-02 15:47 [PATCH v2 00/11] lib/cpumask: get rid of cpumap_print_to_pagebuf() Yury Norov
2026-07-02 15:47 ` [PATCH v2 01/11] arm: Use sysfs_emit() for cpumask show callbacks Yury Norov
2026-07-02 15:58 ` Greg Kroah-Hartman
2026-07-02 16:05 ` Yury Norov
2026-07-02 15:47 ` [PATCH v2 02/11] powerpc: " Yury Norov
2026-07-02 15:47 ` [PATCH v2 03/11] x86/events: " Yury Norov
2026-07-02 15:47 ` [PATCH v2 04/11] cpu: Use sysfs_emit() for cpumask show callback Yury Norov
2026-07-02 15:47 ` [PATCH v2 05/11] devfreq: Use sysfs_emit() for cpumask show callbacks Yury Norov
2026-07-02 15:47 ` [PATCH v2 06/11] fpga: dfl-fme-perf: Use sysfs_emit() for cpumask show Yury Norov
2026-07-02 15:47 ` [PATCH v2 07/11] hwtracing: hisi_ptt: " Yury Norov
2026-07-02 15:47 ` [PATCH v2 08/11] RDMA/hfi1: Use sysfs_emit() for cpumask show helper Yury Norov
2026-07-02 15:47 ` [PATCH v2 09/11] PCI/sysfs: Use sysfs_emit() for cpumask show callbacks Yury Norov
2026-07-02 15:47 ` [PATCH v2 10/11] perf: " Yury Norov
2026-07-02 16:21 ` Robin Murphy
2026-07-02 15:47 ` Yury Norov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260702154725.185376-12-ynorov@nvidia.com \
--to=ynorov@nvidia.com \
--cc=Frank.Li@nxp.com \
--cc=aboorvad@linux.ibm.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=akpm@linux-foundation.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=bhelgaas@google.com \
--cc=bp@alien8.de \
--cc=bwicaksono@nvidia.com \
--cc=chleroy@kernel.org \
--cc=cw00.choi@samsung.com \
--cc=dakr@kernel.org \
--cc=dave.hansen@linux.intel.com \
--cc=dennis.dalessandro@cornelisnetworks.com \
--cc=driver-core@lists.linux.dev \
--cc=fengchengwen@huawei.com \
--cc=festevam@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=gthiagarajan@marvell.com \
--cc=heiko@sntech.de \
--cc=hpa@zytor.com \
--cc=ilkka@os.amperecomputing.com \
--cc=imx@lists.linux.dev \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jbrunet@baylibre.com \
--cc=jgg@ziepe.ca \
--cc=jic23@kernel.org \
--cc=jisheng.teoh@starfivetech.com \
--cc=jiucheng.xu@amlogic.com \
--cc=jolsa@kernel.org \
--cc=kees@kernel.org \
--cc=kernel@pengutronix.de \
--cc=khilman@baylibre.com \
--cc=khuong@os.amperecomputing.com \
--cc=kyungmin.park@samsung.com \
--cc=lcherian@marvell.com \
--cc=leon@kernel.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=linux@rasmusvillemoes.dk \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=make24@iscas.ac.cn \
--cc=mark.rutland@arm.com \
--cc=martin.blumenstingl@googlemail.com \
--cc=mdf@kernel.org \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=myungjoo.ham@samsung.com \
--cc=namhyung@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=npiggin@gmail.com \
--cc=peterz@infradead.org \
--cc=rafael@kernel.org \
--cc=renyu.zj@linux.alibaba.com \
--cc=ritesh.list@gmail.com \
--cc=robin.murphy@arm.com \
--cc=s.hauer@pengutronix.de \
--cc=tglx@kernel.org \
--cc=thomas.weissschuh@linutronix.de \
--cc=trix@redhat.com \
--cc=wangyushan12@huawei.com \
--cc=will@kernel.org \
--cc=x86@kernel.org \
--cc=xu.yang_2@nxp.com \
--cc=xueshuai@linux.alibaba.com \
--cc=yangyicong@hisilicon.com \
--cc=yilun.xu@intel.com \
--cc=yury.norov@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox