bitmap: drop bitmap_print_to_pagebuf()
Subsystems (2)
cover bitmap: drop bitmap_print_to_pagebuf()
bitmap_print_to_pagebuf() users are now all switched to more straightforward alternative. The last one is cpumap_print_to_pagebuf() helper in linux/cpumask.h.
Switch it to scnprintf(), and drop the bitmap_print_to_pagebuf().
Yury Norov (2):
cpumask: switch cpumap_print_to_pagebuf() to using scnprintf()
bitmap: drop bitmap_print_to_pagebuf()
include/linux/bitmap-str.h | 1 - include/linux/cpumask.h | 7 +++++-- lib/bitmap-str.c | 42 +++++--------------------------------- 3 files changed, 10 insertions(+), 40 deletions(-)
Signature · 1 line
2.51.0
PATCH 1/2 cpumask: switch cpumap_print_to_pagebuf() to using scnprintf()
In preparation for removing bitmap_print_to_pagebuf(), switch cpumap_print_to_pagebuf() to using scnprintf("%*pbl").
--- include/linux/cpumask.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
There's ongoing discussion about moving the offset_in_page() out of mm.h to a separate lightweight header [1] and bringing the rest_of_page() helper in addition to offset_in_page(). If that happens, cpumask.h should include the new header and drop opencoding part.
[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/
include/linux/cpumask.h +5 -2
@@ -13,8 +13,10 @@#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> #include <asm/bug.h>
@@ -1326,8 +1328,9 @@ static __always_inline bool cpu_dying(unsigned int cpu) static __always_inline ssize_tcpumap_print_to_pagebuf (bool list,char *buf,const struct cpumask *mask) { -return bitmap_print_to_pagebuf (list, buf,cpumask_bits (mask), - nr_cpu_ids); +/* 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)); }/**
Signature · 1 line
2.51.0
Re: [PATCH 1/2] cpumask: switch cpumap_print_to_pagebuf() to using scnprintf()
Quoted 2 lines · Yury Norov
In preparation for removing
bitmap_print_to_pagebuf(), switchcpumap_print_to_pagebuf()to usingscnprintf("%*pbl").
...
Quoted 1 line
+#include <
vdso/page.h>
Shouldn't this be rather asm/page.h?
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH 2/2 bitmap: drop bitmap_print_to_pagebuf()
In reply to Yury NorovNow that all users of bitmap_print_to_pagebuf() are switched to the alternatives, drop the function.
--- include/linux/bitmap-str.h | 1 - lib/bitmap-str.c | 42 +++++--------------------------------- 2 files changed, 5 insertions(+), 38 deletions(-)
include/linux/bitmap-str.h +0 -1
@@ -5,7 +5,6 @@#include <linux/types.h> int bitmap_parse_user (const char __user *ubuf,unsigned int ulen,unsigned long *dst,int nbits); -int bitmap_print_to_pagebuf (bool list,char *buf,const unsigned long *maskp,int nmaskbits);int bitmap_print_bitmask_to_buf (char *buf,const unsigned long *maskp,int nmaskbits,loff_t off,size_t count); int bitmap_print_list_to_buf(char *buf, const unsigned long *maskp, int nmaskbits,
lib/bitmap-str.c +5 -37
76 lines not on this page · raw message
Signature · 1 line
2.51.0