* [PATCH RESEND 0/5] bitmap: cleanup bitmaps printing
@ 2026-03-03 20:08 Yury Norov
2026-03-03 20:08 ` [PATCH 1/5] powerpc/xive: simplify xive_spapr_debug_show() Yury Norov
` (5 more replies)
0 siblings, 6 replies; 10+ messages in thread
From: Yury Norov @ 2026-03-03 20:08 UTC (permalink / raw)
To: linux-kernel, Christophe Leroy (CS GROUP), Peter Zijlstra (Intel),
Rafael J. Wysocki, Alexander Shishkin, Daniel Lezcano,
Ingo Molnar, James Clark, Kees Cook, Lukasz Luba,
Madhavan Srinivasan, Michael Ellerman, Mike Leach, Moritz Fischer,
Nicholas Piggin, Russ Weight, Shrikanth Hegde, Suki K Poulose,
Tom Rix, Thomas Weißschuh, Xu Yilun, Yury Norov, Zhang Rui,
coresight, linux-arm-kernel, linux-fpga, linux-pm, linuxppc-dev
Cc: Yury Norov, Jakub Kicinski
Bitmap API has a bitmap_print_to_pagebuf() function that is intended to
print bitmap into a human readable format, making sure that the output
string will not get big enough to cross the current page limit.
Some drivers use this function immediately before passing the result to
scnprintf() with no modification. This is useless because scnprintf(),
and helpers based on it like seq_pritf() and sysfs_emit(), take care of
not overflowing the buffer by itself, and perfectly print bitmaps with
"%*pb[l]".
This is a resend of non-networking part of [1]. Patches #3,5 switch from
plain scnprintf() to sysfs_emit(), as pointed out by Thomas Weißschuh.
[1] https://lore.kernel.org/all/20260219181407.290201-1-ynorov@nvidia.com/
The networking part, for reference:
https://lore.kernel.org/all/20260303185507.111841-1-ynorov@nvidia.com/
Each patch can be applied individually per corresponding subsystem.
Yury Norov (5):
powerpc/xive: simplify xive_spapr_debug_show()
thermal: intel: switch cpumask_get() to using
cpumask_print_to_pagebuf()
coresight: don't use bitmap_print_to_pagebuf()
lib/prime_numbers: drop temporary buffer in dump_primes()
fpga: m10bmc-sec: switch show_canceled_csk() to using sysfs_emit()
arch/powerpc/sysdev/xive/spapr.c | 12 ++-----
drivers/fpga/intel-m10-bmc-sec-update.c | 3 +-
.../hwtracing/coresight/coresight-cti-sysfs.c | 32 ++++++++-----------
drivers/thermal/intel/intel_powerclamp.c | 3 +-
lib/math/tests/prime_numbers_kunit.c | 6 ++--
5 files changed, 21 insertions(+), 35 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/5] powerpc/xive: simplify xive_spapr_debug_show()
2026-03-03 20:08 [PATCH RESEND 0/5] bitmap: cleanup bitmaps printing Yury Norov
@ 2026-03-03 20:08 ` Yury Norov
2026-03-03 20:08 ` [PATCH 2/5] thermal: intel: switch cpumask_get() to using cpumask_print_to_pagebuf() Yury Norov
` (4 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Yury Norov @ 2026-03-03 20:08 UTC (permalink / raw)
To: linux-kernel, Christophe Leroy (CS GROUP), Peter Zijlstra (Intel),
Rafael J. Wysocki, Alexander Shishkin, Daniel Lezcano,
Ingo Molnar, James Clark, Kees Cook, Lukasz Luba,
Madhavan Srinivasan, Michael Ellerman, Mike Leach, Moritz Fischer,
Nicholas Piggin, Russ Weight, Shrikanth Hegde, Suki K Poulose,
Tom Rix, Thomas Weißschuh, Xu Yilun, Yury Norov, Zhang Rui,
coresight, linux-arm-kernel, linux-fpga, linux-pm, linuxppc-dev,
Yury Norov
Cc: Jakub Kicinski
The function creates temporary buffer to convert xibm->bitmap to a
human-readable list before passing it to seq_printf. Drop it and print
the list by seq_printf() directly with the "%*pbl" specifier.
Reviewed-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Signed-off-by: Yury Norov <ynorov@nvidia.com>
---
arch/powerpc/sysdev/xive/spapr.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c
index 61f8a8acf81f..fdf52c78ac02 100644
--- a/arch/powerpc/sysdev/xive/spapr.c
+++ b/arch/powerpc/sysdev/xive/spapr.c
@@ -667,17 +667,9 @@ static void xive_spapr_sync_source(u32 hw_irq)
static int xive_spapr_debug_show(struct seq_file *m, void *private)
{
struct xive_irq_bitmap *xibm;
- char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
- if (!buf)
- return -ENOMEM;
-
- list_for_each_entry(xibm, &xive_irq_bitmaps, list) {
- memset(buf, 0, PAGE_SIZE);
- bitmap_print_to_pagebuf(true, buf, xibm->bitmap, xibm->count);
- seq_printf(m, "bitmap #%d: %s", xibm->count, buf);
- }
- kfree(buf);
+ list_for_each_entry(xibm, &xive_irq_bitmaps, list)
+ seq_printf(m, "bitmap #%d: %*pbl\n", xibm->count, xibm->count, xibm->bitmap);
return 0;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/5] thermal: intel: switch cpumask_get() to using cpumask_print_to_pagebuf()
2026-03-03 20:08 [PATCH RESEND 0/5] bitmap: cleanup bitmaps printing Yury Norov
2026-03-03 20:08 ` [PATCH 1/5] powerpc/xive: simplify xive_spapr_debug_show() Yury Norov
@ 2026-03-03 20:08 ` Yury Norov
2026-03-03 20:08 ` [PATCH 3/5] coresight: don't use bitmap_print_to_pagebuf() Yury Norov
` (3 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Yury Norov @ 2026-03-03 20:08 UTC (permalink / raw)
To: linux-kernel, Christophe Leroy (CS GROUP), Peter Zijlstra (Intel),
Rafael J. Wysocki, Alexander Shishkin, Daniel Lezcano,
Ingo Molnar, James Clark, Kees Cook, Lukasz Luba,
Madhavan Srinivasan, Michael Ellerman, Mike Leach, Moritz Fischer,
Nicholas Piggin, Russ Weight, Shrikanth Hegde, Suki K Poulose,
Tom Rix, Thomas Weißschuh, Xu Yilun, Yury Norov, Zhang Rui,
coresight, linux-arm-kernel, linux-fpga, linux-pm, linuxppc-dev,
Yury Norov
Cc: Jakub Kicinski
The function opencodes cpumask_print_to_pagebuf() with more generic
bitmap_print_to_pagebuf(). Switch to using the proper API.
Signed-off-by: Yury Norov <ynorov@nvidia.com>
---
drivers/thermal/intel/intel_powerclamp.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/thermal/intel/intel_powerclamp.c b/drivers/thermal/intel/intel_powerclamp.c
index 9a4cec000910..ccf380da12f2 100644
--- a/drivers/thermal/intel/intel_powerclamp.c
+++ b/drivers/thermal/intel/intel_powerclamp.c
@@ -200,8 +200,7 @@ static int cpumask_get(char *buf, const struct kernel_param *kp)
if (!cpumask_available(idle_injection_cpu_mask))
return -ENODEV;
- return bitmap_print_to_pagebuf(false, buf, cpumask_bits(idle_injection_cpu_mask),
- nr_cpumask_bits);
+ return cpumap_print_to_pagebuf(false, buf, idle_injection_cpu_mask);
}
static const struct kernel_param_ops cpumask_ops = {
--
2.43.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/5] coresight: don't use bitmap_print_to_pagebuf()
2026-03-03 20:08 [PATCH RESEND 0/5] bitmap: cleanup bitmaps printing Yury Norov
2026-03-03 20:08 ` [PATCH 1/5] powerpc/xive: simplify xive_spapr_debug_show() Yury Norov
2026-03-03 20:08 ` [PATCH 2/5] thermal: intel: switch cpumask_get() to using cpumask_print_to_pagebuf() Yury Norov
@ 2026-03-03 20:08 ` Yury Norov
2026-03-03 20:08 ` [PATCH 4/5] lib/prime_numbers: drop temporary buffer in dump_primes() Yury Norov
` (2 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Yury Norov @ 2026-03-03 20:08 UTC (permalink / raw)
To: linux-kernel, Christophe Leroy (CS GROUP), Peter Zijlstra (Intel),
Rafael J. Wysocki, Alexander Shishkin, Daniel Lezcano,
Ingo Molnar, James Clark, Kees Cook, Lukasz Luba,
Madhavan Srinivasan, Michael Ellerman, Mike Leach, Moritz Fischer,
Nicholas Piggin, Russ Weight, Shrikanth Hegde, Suki K Poulose,
Tom Rix, Thomas Weißschuh, Xu Yilun, Yury Norov, Zhang Rui,
coresight, linux-arm-kernel, linux-fpga, linux-pm, linuxppc-dev
Cc: Yury Norov, Jakub Kicinski
Switch the driver to using the proper sysfs_emit("%*pbl") where
appropriate.
Suggested-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Yury Norov <ynorov@nvidia.com>
---
.../hwtracing/coresight/coresight-cti-sysfs.c | 32 ++++++++-----------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/drivers/hwtracing/coresight/coresight-cti-sysfs.c b/drivers/hwtracing/coresight/coresight-cti-sysfs.c
index 572b80ee96fb..26ec0d8ed181 100644
--- a/drivers/hwtracing/coresight/coresight-cti-sysfs.c
+++ b/drivers/hwtracing/coresight/coresight-cti-sysfs.c
@@ -606,14 +606,11 @@ static ssize_t chan_gate_enable_show(struct device *dev,
struct cti_drvdata *drvdata = dev_get_drvdata(dev->parent);
struct cti_config *cfg = &drvdata->config;
unsigned long ctigate_bitmask = cfg->ctigate;
- int size = 0;
if (cfg->ctigate == 0)
- size = sprintf(buf, "\n");
- else
- size = bitmap_print_to_pagebuf(true, buf, &ctigate_bitmask,
- cfg->nr_ctm_channels);
- return size;
+ return sprintf(buf, "\n");
+
+ return sysfs_emit(buf, "%*pbl\n", cfg->nr_ctm_channels, &ctigate_bitmask);
}
static DEVICE_ATTR_RW(chan_gate_enable);
@@ -710,12 +707,13 @@ static ssize_t trigout_filtered_show(struct device *dev,
{
struct cti_drvdata *drvdata = dev_get_drvdata(dev->parent);
struct cti_config *cfg = &drvdata->config;
- int size = 0, nr_trig_max = cfg->nr_trig_max;
+ int nr_trig_max = cfg->nr_trig_max;
unsigned long mask = cfg->trig_out_filter;
- if (mask)
- size = bitmap_print_to_pagebuf(true, buf, &mask, nr_trig_max);
- return size;
+ if (mask == 0)
+ return 0;
+
+ return sysfs_emit(buf, "%*pbl\n", nr_trig_max, &mask);
}
static DEVICE_ATTR_RO(trigout_filtered);
@@ -834,7 +832,7 @@ static ssize_t print_chan_list(struct device *dev,
{
struct cti_drvdata *drvdata = dev_get_drvdata(dev->parent);
struct cti_config *config = &drvdata->config;
- int size, i;
+ int i;
unsigned long inuse_bits = 0, chan_mask;
/* scan regs to get bitmap of channels in use. */
@@ -852,11 +850,9 @@ static ssize_t print_chan_list(struct device *dev,
/* list of channels, or 'none' */
chan_mask = GENMASK(config->nr_ctm_channels - 1, 0);
if (inuse_bits & chan_mask)
- size = bitmap_print_to_pagebuf(true, buf, &inuse_bits,
- config->nr_ctm_channels);
- else
- size = sprintf(buf, "\n");
- return size;
+ return sysfs_emit(buf, "%*pbl\n", config->nr_ctm_channels, &inuse_bits);
+
+ return sprintf(buf, "\n");
}
static ssize_t chan_inuse_show(struct device *dev,
@@ -928,7 +924,7 @@ static ssize_t trigin_sig_show(struct device *dev,
struct cti_config *cfg = &drvdata->config;
unsigned long mask = con->con_in->used_mask;
- return bitmap_print_to_pagebuf(true, buf, &mask, cfg->nr_trig_max);
+ return sysfs_emit(buf, "%*pbl\n", cfg->nr_trig_max, &mask);
}
static ssize_t trigout_sig_show(struct device *dev,
@@ -942,7 +938,7 @@ static ssize_t trigout_sig_show(struct device *dev,
struct cti_config *cfg = &drvdata->config;
unsigned long mask = con->con_out->used_mask;
- return bitmap_print_to_pagebuf(true, buf, &mask, cfg->nr_trig_max);
+ return sysfs_emit(buf, "%*pbl\n", cfg->nr_trig_max, &mask);
}
/* convert a sig type id to a name */
--
2.43.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/5] lib/prime_numbers: drop temporary buffer in dump_primes()
2026-03-03 20:08 [PATCH RESEND 0/5] bitmap: cleanup bitmaps printing Yury Norov
` (2 preceding siblings ...)
2026-03-03 20:08 ` [PATCH 3/5] coresight: don't use bitmap_print_to_pagebuf() Yury Norov
@ 2026-03-03 20:08 ` Yury Norov
2026-03-03 20:08 ` [PATCH 5/5] fpga: m10bmc-sec: switch show_canceled_csk() to using sysfs_emit() Yury Norov
2026-03-19 20:18 ` [PATCH RESEND 0/5] bitmap: cleanup bitmaps printing Yury Norov
5 siblings, 0 replies; 10+ messages in thread
From: Yury Norov @ 2026-03-03 20:08 UTC (permalink / raw)
To: linux-kernel, Christophe Leroy (CS GROUP), Peter Zijlstra (Intel),
Rafael J. Wysocki, Alexander Shishkin, Daniel Lezcano,
Ingo Molnar, James Clark, Kees Cook, Lukasz Luba,
Madhavan Srinivasan, Michael Ellerman, Mike Leach, Moritz Fischer,
Nicholas Piggin, Russ Weight, Shrikanth Hegde, Suki K Poulose,
Tom Rix, Thomas Weißschuh, Xu Yilun, Yury Norov, Zhang Rui,
coresight, linux-arm-kernel, linux-fpga, linux-pm, linuxppc-dev,
Yury Norov
Cc: Jakub Kicinski
The function uses temporary buffer to convert primes bitmap into
human readable format. Switch to using kunit_info("%*pbl")", and
drop the buffer.
Signed-off-by: Yury Norov <ynorov@nvidia.com>
---
lib/math/tests/prime_numbers_kunit.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/lib/math/tests/prime_numbers_kunit.c b/lib/math/tests/prime_numbers_kunit.c
index 2f1643208c66..55ac160c6dfa 100644
--- a/lib/math/tests/prime_numbers_kunit.c
+++ b/lib/math/tests/prime_numbers_kunit.c
@@ -8,12 +8,10 @@
static void dump_primes(void *ctx, const struct primes *p)
{
- static char buf[PAGE_SIZE];
struct kunit_suite *suite = ctx;
- bitmap_print_to_pagebuf(true, buf, p->primes, p->sz);
- kunit_info(suite, "primes.{last=%lu, .sz=%lu, .primes[]=...x%lx} = %s",
- p->last, p->sz, p->primes[BITS_TO_LONGS(p->sz) - 1], buf);
+ kunit_info(suite, "primes.{last=%lu, .sz=%lu, .primes[]=...x%lx} = %*pbl",
+ p->last, p->sz, p->primes[BITS_TO_LONGS(p->sz) - 1], (int)p->sz, p->primes);
}
static void prime_numbers_test(struct kunit *test)
--
2.43.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 5/5] fpga: m10bmc-sec: switch show_canceled_csk() to using sysfs_emit()
2026-03-03 20:08 [PATCH RESEND 0/5] bitmap: cleanup bitmaps printing Yury Norov
` (3 preceding siblings ...)
2026-03-03 20:08 ` [PATCH 4/5] lib/prime_numbers: drop temporary buffer in dump_primes() Yury Norov
@ 2026-03-03 20:08 ` Yury Norov
2026-03-24 9:15 ` Xu Yilun
2026-03-19 20:18 ` [PATCH RESEND 0/5] bitmap: cleanup bitmaps printing Yury Norov
5 siblings, 1 reply; 10+ messages in thread
From: Yury Norov @ 2026-03-03 20:08 UTC (permalink / raw)
To: linux-kernel, Christophe Leroy (CS GROUP), Peter Zijlstra (Intel),
Rafael J. Wysocki, Alexander Shishkin, Daniel Lezcano,
Ingo Molnar, James Clark, Kees Cook, Lukasz Luba,
Madhavan Srinivasan, Michael Ellerman, Mike Leach, Moritz Fischer,
Nicholas Piggin, Russ Weight, Shrikanth Hegde, Suki K Poulose,
Tom Rix, Thomas Weißschuh, Xu Yilun, Yury Norov, Zhang Rui,
coresight, linux-arm-kernel, linux-fpga, linux-pm, linuxppc-dev
Cc: Yury Norov, Jakub Kicinski
Switch show_canceled_csk() to use the proper sysfs_emit("%*pbl").
Reviewed-by: Russ Weight <russ.weight@linux.dev>
Suggested-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Yury Norov <ynorov@nvidia.com>
---
drivers/fpga/intel-m10-bmc-sec-update.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/fpga/intel-m10-bmc-sec-update.c b/drivers/fpga/intel-m10-bmc-sec-update.c
index 10f678b9ed36..ae364c6636eb 100644
--- a/drivers/fpga/intel-m10-bmc-sec-update.c
+++ b/drivers/fpga/intel-m10-bmc-sec-update.c
@@ -10,6 +10,7 @@
#include <linux/firmware.h>
#include <linux/mfd/intel-m10-bmc.h>
#include <linux/mod_devicetable.h>
+#include <linux/mm.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
@@ -183,7 +184,7 @@ show_canceled_csk(struct device *dev, u32 addr, char *buf)
bitmap_from_arr32(csk_map, csk32, CSK_BIT_LEN);
bitmap_complement(csk_map, csk_map, CSK_BIT_LEN);
- return bitmap_print_to_pagebuf(1, buf, csk_map, CSK_BIT_LEN);
+ return sysfs_emit(buf, "%*pbl\n", CSK_BIT_LEN, csk_map);
}
#define DEVICE_ATTR_SEC_CSK_RO(_name) \
--
2.43.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH RESEND 0/5] bitmap: cleanup bitmaps printing
2026-03-03 20:08 [PATCH RESEND 0/5] bitmap: cleanup bitmaps printing Yury Norov
` (4 preceding siblings ...)
2026-03-03 20:08 ` [PATCH 5/5] fpga: m10bmc-sec: switch show_canceled_csk() to using sysfs_emit() Yury Norov
@ 2026-03-19 20:18 ` Yury Norov
5 siblings, 0 replies; 10+ messages in thread
From: Yury Norov @ 2026-03-19 20:18 UTC (permalink / raw)
To: linux-kernel, Christophe Leroy (CS GROUP), Peter Zijlstra (Intel),
Rafael J. Wysocki, Alexander Shishkin, Daniel Lezcano,
Ingo Molnar, James Clark, Kees Cook, Lukasz Luba,
Madhavan Srinivasan, Michael Ellerman, Mike Leach, Moritz Fischer,
Nicholas Piggin, Russ Weight, Shrikanth Hegde, Suki K Poulose,
Tom Rix, Thomas Weißschuh, Xu Yilun, Yury Norov, Zhang Rui,
coresight, linux-arm-kernel, linux-fpga, linux-pm, linuxppc-dev
Cc: Jakub Kicinski
Ping?
On Tue, Mar 03, 2026 at 03:08:36PM -0500, Yury Norov wrote:
> Bitmap API has a bitmap_print_to_pagebuf() function that is intended to
> print bitmap into a human readable format, making sure that the output
> string will not get big enough to cross the current page limit.
>
> Some drivers use this function immediately before passing the result to
> scnprintf() with no modification. This is useless because scnprintf(),
> and helpers based on it like seq_pritf() and sysfs_emit(), take care of
> not overflowing the buffer by itself, and perfectly print bitmaps with
> "%*pb[l]".
>
> This is a resend of non-networking part of [1]. Patches #3,5 switch from
> plain scnprintf() to sysfs_emit(), as pointed out by Thomas Weißschuh.
>
> [1] https://lore.kernel.org/all/20260219181407.290201-1-ynorov@nvidia.com/
>
> The networking part, for reference:
>
> https://lore.kernel.org/all/20260303185507.111841-1-ynorov@nvidia.com/
>
> Each patch can be applied individually per corresponding subsystem.
>
> Yury Norov (5):
> powerpc/xive: simplify xive_spapr_debug_show()
> thermal: intel: switch cpumask_get() to using
> cpumask_print_to_pagebuf()
> coresight: don't use bitmap_print_to_pagebuf()
> lib/prime_numbers: drop temporary buffer in dump_primes()
> fpga: m10bmc-sec: switch show_canceled_csk() to using sysfs_emit()
>
> arch/powerpc/sysdev/xive/spapr.c | 12 ++-----
> drivers/fpga/intel-m10-bmc-sec-update.c | 3 +-
> .../hwtracing/coresight/coresight-cti-sysfs.c | 32 ++++++++-----------
> drivers/thermal/intel/intel_powerclamp.c | 3 +-
> lib/math/tests/prime_numbers_kunit.c | 6 ++--
> 5 files changed, 21 insertions(+), 35 deletions(-)
>
> --
> 2.43.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 5/5] fpga: m10bmc-sec: switch show_canceled_csk() to using sysfs_emit()
2026-03-03 20:08 ` [PATCH 5/5] fpga: m10bmc-sec: switch show_canceled_csk() to using sysfs_emit() Yury Norov
@ 2026-03-24 9:15 ` Xu Yilun
2026-03-24 18:38 ` Yury Norov
0 siblings, 1 reply; 10+ messages in thread
From: Xu Yilun @ 2026-03-24 9:15 UTC (permalink / raw)
To: Yury Norov
Cc: linux-kernel, Christophe Leroy (CS GROUP), Peter Zijlstra (Intel),
Rafael J. Wysocki, Alexander Shishkin, Daniel Lezcano,
Ingo Molnar, James Clark, Kees Cook, Lukasz Luba,
Madhavan Srinivasan, Michael Ellerman, Mike Leach, Moritz Fischer,
Nicholas Piggin, Russ Weight, Shrikanth Hegde, Suki K Poulose,
Tom Rix, Thomas Weißschuh, Xu Yilun, Yury Norov, Zhang Rui,
coresight, linux-arm-kernel, linux-fpga, linux-pm, linuxppc-dev,
Jakub Kicinski
On Tue, Mar 03, 2026 at 03:08:41PM -0500, Yury Norov wrote:
> Switch show_canceled_csk() to use the proper sysfs_emit("%*pbl").
>
> Reviewed-by: Russ Weight <russ.weight@linux.dev>
> Suggested-by: Thomas Weißschuh <linux@weissschuh.net>
> Signed-off-by: Yury Norov <ynorov@nvidia.com>
> ---
> drivers/fpga/intel-m10-bmc-sec-update.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/fpga/intel-m10-bmc-sec-update.c b/drivers/fpga/intel-m10-bmc-sec-update.c
> index 10f678b9ed36..ae364c6636eb 100644
> --- a/drivers/fpga/intel-m10-bmc-sec-update.c
> +++ b/drivers/fpga/intel-m10-bmc-sec-update.c
> @@ -10,6 +10,7 @@
> #include <linux/firmware.h>
> #include <linux/mfd/intel-m10-bmc.h>
> #include <linux/mod_devicetable.h>
> +#include <linux/mm.h>
Why add this header file?
Thanks,
Yilun
> #include <linux/module.h>
> #include <linux/platform_device.h>
> #include <linux/slab.h>
> @@ -183,7 +184,7 @@ show_canceled_csk(struct device *dev, u32 addr, char *buf)
>
> bitmap_from_arr32(csk_map, csk32, CSK_BIT_LEN);
> bitmap_complement(csk_map, csk_map, CSK_BIT_LEN);
> - return bitmap_print_to_pagebuf(1, buf, csk_map, CSK_BIT_LEN);
> + return sysfs_emit(buf, "%*pbl\n", CSK_BIT_LEN, csk_map);
> }
>
> #define DEVICE_ATTR_SEC_CSK_RO(_name) \
> --
> 2.43.0
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 5/5] fpga: m10bmc-sec: switch show_canceled_csk() to using sysfs_emit()
2026-03-24 9:15 ` Xu Yilun
@ 2026-03-24 18:38 ` Yury Norov
2026-03-25 7:25 ` Xu Yilun
0 siblings, 1 reply; 10+ messages in thread
From: Yury Norov @ 2026-03-24 18:38 UTC (permalink / raw)
To: Xu Yilun
Cc: linux-kernel, Christophe Leroy (CS GROUP), Peter Zijlstra (Intel),
Rafael J. Wysocki, Alexander Shishkin, Daniel Lezcano,
Ingo Molnar, James Clark, Kees Cook, Lukasz Luba,
Madhavan Srinivasan, Michael Ellerman, Mike Leach, Moritz Fischer,
Nicholas Piggin, Russ Weight, Shrikanth Hegde, Suki K Poulose,
Tom Rix, Thomas Weißschuh, Xu Yilun, Yury Norov, Zhang Rui,
coresight, linux-arm-kernel, linux-fpga, linux-pm, linuxppc-dev,
Jakub Kicinski
On Tue, Mar 24, 2026 at 05:15:33PM +0800, Xu Yilun wrote:
> On Tue, Mar 03, 2026 at 03:08:41PM -0500, Yury Norov wrote:
> > Switch show_canceled_csk() to use the proper sysfs_emit("%*pbl").
> >
> > Reviewed-by: Russ Weight <russ.weight@linux.dev>
> > Suggested-by: Thomas Weißschuh <linux@weissschuh.net>
> > Signed-off-by: Yury Norov <ynorov@nvidia.com>
> > ---
> > drivers/fpga/intel-m10-bmc-sec-update.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/fpga/intel-m10-bmc-sec-update.c b/drivers/fpga/intel-m10-bmc-sec-update.c
> > index 10f678b9ed36..ae364c6636eb 100644
> > --- a/drivers/fpga/intel-m10-bmc-sec-update.c
> > +++ b/drivers/fpga/intel-m10-bmc-sec-update.c
> > @@ -10,6 +10,7 @@
> > #include <linux/firmware.h>
> > #include <linux/mfd/intel-m10-bmc.h>
> > #include <linux/mod_devicetable.h>
> > +#include <linux/mm.h>
>
> Why add this header file?
When I was preparing the series, I had build issues without this. But
now I checked it against -rc5, and it's clean. Would you like me to
resend?
> > #include <linux/module.h>
> > #include <linux/platform_device.h>
> > #include <linux/slab.h>
> > @@ -183,7 +184,7 @@ show_canceled_csk(struct device *dev, u32 addr, char *buf)
> >
> > bitmap_from_arr32(csk_map, csk32, CSK_BIT_LEN);
> > bitmap_complement(csk_map, csk_map, CSK_BIT_LEN);
> > - return bitmap_print_to_pagebuf(1, buf, csk_map, CSK_BIT_LEN);
> > + return sysfs_emit(buf, "%*pbl\n", CSK_BIT_LEN, csk_map);
> > }
> >
> > #define DEVICE_ATTR_SEC_CSK_RO(_name) \
> > --
> > 2.43.0
> >
> >
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 5/5] fpga: m10bmc-sec: switch show_canceled_csk() to using sysfs_emit()
2026-03-24 18:38 ` Yury Norov
@ 2026-03-25 7:25 ` Xu Yilun
0 siblings, 0 replies; 10+ messages in thread
From: Xu Yilun @ 2026-03-25 7:25 UTC (permalink / raw)
To: Yury Norov
Cc: linux-kernel, Christophe Leroy (CS GROUP), Peter Zijlstra (Intel),
Rafael J. Wysocki, Alexander Shishkin, Daniel Lezcano,
Ingo Molnar, James Clark, Kees Cook, Lukasz Luba,
Madhavan Srinivasan, Michael Ellerman, Mike Leach, Moritz Fischer,
Nicholas Piggin, Russ Weight, Shrikanth Hegde, Suki K Poulose,
Tom Rix, Thomas Weißschuh, Xu Yilun, Yury Norov, Zhang Rui,
coresight, linux-arm-kernel, linux-fpga, linux-pm, linuxppc-dev,
Jakub Kicinski
On Tue, Mar 24, 2026 at 02:38:04PM -0400, Yury Norov wrote:
> On Tue, Mar 24, 2026 at 05:15:33PM +0800, Xu Yilun wrote:
> > On Tue, Mar 03, 2026 at 03:08:41PM -0500, Yury Norov wrote:
> > > Switch show_canceled_csk() to use the proper sysfs_emit("%*pbl").
> > >
> > > Reviewed-by: Russ Weight <russ.weight@linux.dev>
> > > Suggested-by: Thomas Weißschuh <linux@weissschuh.net>
> > > Signed-off-by: Yury Norov <ynorov@nvidia.com>
> > > ---
> > > drivers/fpga/intel-m10-bmc-sec-update.c | 3 ++-
> > > 1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/fpga/intel-m10-bmc-sec-update.c b/drivers/fpga/intel-m10-bmc-sec-update.c
> > > index 10f678b9ed36..ae364c6636eb 100644
> > > --- a/drivers/fpga/intel-m10-bmc-sec-update.c
> > > +++ b/drivers/fpga/intel-m10-bmc-sec-update.c
> > > @@ -10,6 +10,7 @@
> > > #include <linux/firmware.h>
> > > #include <linux/mfd/intel-m10-bmc.h>
> > > #include <linux/mod_devicetable.h>
> > > +#include <linux/mm.h>
> >
> > Why add this header file?
>
> When I was preparing the series, I had build issues without this. But
> now I checked it against -rc5, and it's clean. Would you like me to
> resend?
No need. Given that I'll pick this patch alone to fpga for-next with the
fix.
Reviewed-by: Xu Yilun <yilun.xu@intel.com>
>
> > > #include <linux/module.h>
> > > #include <linux/platform_device.h>
> > > #include <linux/slab.h>
> > > @@ -183,7 +184,7 @@ show_canceled_csk(struct device *dev, u32 addr, char *buf)
> > >
> > > bitmap_from_arr32(csk_map, csk32, CSK_BIT_LEN);
> > > bitmap_complement(csk_map, csk_map, CSK_BIT_LEN);
> > > - return bitmap_print_to_pagebuf(1, buf, csk_map, CSK_BIT_LEN);
> > > + return sysfs_emit(buf, "%*pbl\n", CSK_BIT_LEN, csk_map);
> > > }
> > >
> > > #define DEVICE_ATTR_SEC_CSK_RO(_name) \
> > > --
> > > 2.43.0
> > >
> > >
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2026-03-25 7:46 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-03 20:08 [PATCH RESEND 0/5] bitmap: cleanup bitmaps printing Yury Norov
2026-03-03 20:08 ` [PATCH 1/5] powerpc/xive: simplify xive_spapr_debug_show() Yury Norov
2026-03-03 20:08 ` [PATCH 2/5] thermal: intel: switch cpumask_get() to using cpumask_print_to_pagebuf() Yury Norov
2026-03-03 20:08 ` [PATCH 3/5] coresight: don't use bitmap_print_to_pagebuf() Yury Norov
2026-03-03 20:08 ` [PATCH 4/5] lib/prime_numbers: drop temporary buffer in dump_primes() Yury Norov
2026-03-03 20:08 ` [PATCH 5/5] fpga: m10bmc-sec: switch show_canceled_csk() to using sysfs_emit() Yury Norov
2026-03-24 9:15 ` Xu Yilun
2026-03-24 18:38 ` Yury Norov
2026-03-25 7:25 ` Xu Yilun
2026-03-19 20:18 ` [PATCH RESEND 0/5] bitmap: cleanup bitmaps printing Yury Norov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox