diff options
| author | Thierry Reding <treding@nvidia.com> | 2026-04-30 11:07:33 +0200 |
|---|---|---|
| committer | Thierry Reding <treding@nvidia.com> | 2026-04-30 11:07:33 +0200 |
| commit | e624266109eb1e775051d5382a9d1a9d8ed4580a (patch) | |
| tree | 71135379b3995e59cb7819cf818aa12e03a0c051 | |
| parent | e6759d98b66fd098b9d9bbf97d7939d6cabd7235 (diff) | |
| download | linux-next-e624266109eb1e775051d5382a9d1a9d8ed4580a.tar.gz | |
Revert "cpumask: switch cpumap_print_to_pagebuf() to using scnprintf()"
This reverts commit 6d3a0b07f271daf0b45ea2c675b2c5cc7c2288ea.
| -rw-r--r-- | include/linux/cpumask.h | 17 | ||||
| -rw-r--r-- | lib/cpumask.c | 17 |
2 files changed, 16 insertions, 18 deletions
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 02cae16c941a8..80211900f3739 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h @@ -1313,7 +1313,22 @@ static __always_inline bool cpu_dying(unsigned int cpu) } #endif /* NR_CPUS > BITS_PER_LONG */ -ssize_t cpumap_print_to_pagebuf(bool list, char *buf, const struct cpumask *mask); +/** + * 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) +{ + return bitmap_print_to_pagebuf(list, buf, cpumask_bits(mask), + nr_cpu_ids); +} /** * cpumap_print_bitmask_to_buf - copies the cpumask into the buffer as diff --git a/lib/cpumask.c b/lib/cpumask.c index 1c8ca31e270d4..5adb9874fbd0f 100644 --- a/lib/cpumask.c +++ b/lib/cpumask.c @@ -166,20 +166,3 @@ unsigned int cpumask_any_distribute(const struct cpumask *srcp) return next; } EXPORT_SYMBOL(cpumask_any_distribute); - -/** - * 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. - */ -ssize_t cpumap_print_to_pagebuf(bool list, char *buf, const struct cpumask *mask) -{ - return scnprintf(buf, PAGE_SIZE - offset_in_page(buf), - list ? "%*pbl\n" : "%*pb\n", cpumask_pr_args(mask)); -} -EXPORT_SYMBOL(cpumap_print_to_pagebuf); |
