[PATCH v2 0/2] net: cleanup bitmaps printing

Yury Norov posted 2 patches 2 weeks, 1 day ago
.../marvell/octeontx2/af/rvu_debugfs.c        | 28 ++++---------------
net/core/net-sysfs.c                          |  2 +-
2 files changed, 6 insertions(+), 24 deletions(-)
[PATCH v2 0/2] net: cleanup bitmaps printing
Posted by Yury Norov 2 weeks, 1 day ago
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]".

v1: https://lore.kernel.org/all/20260219181407.290201-1-ynorov@nvidia.com/
v2:
 - fix copy-paste error in print_npa_qsize() (Simon);
 - fix typo in #1 subject (Jakub).

Yury Norov (2):
  octeontx2-af: siplify rvu_debugfs
  net-sysfs: switch xps_queue_show() to sysfs_emit()

 .../marvell/octeontx2/af/rvu_debugfs.c        | 28 ++++---------------
 net/core/net-sysfs.c                          |  2 +-
 2 files changed, 6 insertions(+), 24 deletions(-)

-- 
2.43.0
Re: [PATCH v2 0/2] net: cleanup bitmaps printing
Posted by Simon Horman 2 weeks ago
On Thu, Mar 19, 2026 at 04:17:09PM -0400, 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]".
> 
> v1: https://lore.kernel.org/all/20260219181407.290201-1-ynorov@nvidia.com/
> v2:
>  - fix copy-paste error in print_npa_qsize() (Simon);
>  - fix typo in #1 subject (Jakub).

Thanks for the updates.

Reviewed-by: Simon Horman <horms@kernel.org>