Skip to content

cleanup bitmaps printing in sysfs

Yury Norov linux-arm-kernel linux-fpga linux-pm linuxppc-dev lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12powerpc/xive: simplify xive_spapr_debug_show()arch/powerpc/sysdev/xive/spapr.c+2 -101 reply
2/12octeontx2-af: siplify rvu_debugfsdrivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c+5 -230 replies
3/12thermal: intel: switch cpumask_get() to using cpumask_print_to_pagebuf()drivers/thermal/intel/intel_powerclamp.c+1 -20 replies
4/12lib/prime_numbers: drop temporary buffer in dump_primes()lib/math/tests/prime_numbers_kunit.c+2 -40 replies
5/12bitmap: switch test to scnprintf("%*pbl")lib/test_bitmap.c+5 -50 replies
6/12bitmap: align test_bitmap outputlib/test_bitmap.c+6 -70 replies
7/12mm: add rest_of_page() macroarch/arm64/kernel/patching.c arch/powerpc/lib/code-patching.c arch/riscv/kernel/sbi.c +26 more+53 -780 replies
8/12coresight: don't use bitmap_print_to_pagebuf()drivers/hwtracing/coresight/coresight-cti-sysfs.c+15 -181 reply
9/12fpga: m10bmc-sec: switch show_canceled_csk() to using scnprintf()drivers/fpga/intel-m10-bmc-sec-update.c+2 -12 replies
10/12net-sysfs: switch xps_queue_show() to using scnprintf()net/core/net-sysfs.c+1 -10 replies
11/12cpumask: switch cpumap_print_to_pagebuf() to using scnprintf()include/linux/cpumask.h lib/cpumask.c+18 -160 replies
12/12bitmap: drop bitmap_print_to_pagebuf()include/linux/bitmap-str.h lib/bitmap-str.c+5 -380 replies

Reviews trailers per patch

2 of 12 patches have a Reviewed-by or Acked-by.

PatchRuss WeightShrikanth Hegde
1/12R-b
2/12
3/12
4/12
5/12
6/12
7/12
8/12
9/12R-b
10/12
11/12
12/12

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/12] cleanup bitmaps printing in sysfs

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 seq_printf() with no modification. This is useless because seq_pritf() takes care of not overflowing the buffer by itself, and perfectly prints bitmaps with "%*pb[l]".

The first 6 patches of the series convert such bitmap_print_to_pagebuf() users to just print the bitmap with seq_printf().

Patch #7 adds (actually moves from net/p9 driver) a handy macro rest_of_page() and applies it globally.

The rest of the series switches all other users to scnprintf("%*pb[l]"), so that users wont abuse kmalloc() + bitmap_print_to_pagebuf().

Patches 1-6 may be applied individually, or together with the rest of the series, at maintainers' discretion.

Yury Norov (12):
powerpc/xive: simplify xive_spapr_debug_show()
octeontx2-af: siplify rvu_debugfs
thermal: intel: switch cpumask_get() to using
cpumask_print_to_pagebuf()
lib/prime_numbers: drop temporary buffer in dump_primes()
bitmap: switch test to scnprintf("%*pbl")
bitmap: align test_bitmap output
mm: add rest_of_page() macro
coresight: don't use bitmap_print_to_pagebuf()
fpga: m10bmc-sec: switch show_canceled_csk() to using scnprintf()
net-sysfs: switch xps_queue_show() to using scnprintf()
cpumask: switch cpumap_print_to_pagebuf() to using scnprintf()
bitmap: drop bitmap_print_to_pagebuf()

 arch/arm64/kernel/patching.c                  |  4 +-
 arch/powerpc/lib/code-patching.c              |  6 +--
 arch/powerpc/sysdev/xive/spapr.c              | 12 +-----
 arch/riscv/kernel/sbi.c                       |  4 +-
 arch/s390/kvm/gaccess.c                       |  6 +--
 arch/x86/kvm/emulate.c                        |  4 +-
 drivers/block/null_blk/main.c                 |  6 +--
 drivers/fpga/intel-m10-bmc-sec-update.c       |  3 +-
 drivers/gpu/drm/i915/gt/shmem_utils.c         |  5 +--
 .../hwtracing/coresight/coresight-cti-sysfs.c | 33 +++++++--------
 drivers/md/dm-pcache/backing_dev.h            |  2 +-
 .../marvell/octeontx2/af/rvu_debugfs.c        | 28 +++----------
 drivers/net/ethernet/meta/fbnic/fbnic_tlv.c   |  6 +--
 drivers/s390/net/qeth_core_main.c             |  6 +--
 drivers/spi/spi-pl022.c                       |  3 +-
 drivers/spi/spi.c                             |  4 +-
 drivers/thermal/intel/intel_powerclamp.c      |  3 +-
 fs/ext4/verity.c                              |  3 +-
 fs/f2fs/verity.c                              |  6 +--
 fs/fuse/dev.c                                 |  4 +-
 fs/iomap/buffered-io.c                        |  2 +-
 fs/nfs/pagelist.c                             |  2 +-
 fs/remap_range.c                              |  3 +-
 fs/xfs/scrub/xfile.c                          |  3 +-
 include/crypto/scatterwalk.h                  |  2 +-
 include/linux/bitmap-str.h                    |  1 -
 include/linux/cpumask.h                       | 17 +-------
 include/linux/highmem.h                       | 24 +++++------
 include/linux/iomap.h                         |  2 +-
 include/linux/iov_iter.h                      |  3 +-
 include/linux/mm.h                            |  2 +
 kernel/events/ring_buffer.c                   |  2 +-
 lib/bitmap-str.c                              | 42 +++----------------
 lib/cpumask.c                                 | 17 ++++++++
 lib/iov_iter.c                                |  5 +--
 lib/math/tests/prime_numbers_kunit.c          |  6 +--
 lib/test_bitmap.c                             | 17 ++++----
 net/9p/trans_virtio.c                         |  6 ---
 net/core/net-sysfs.c                          |  2 +-
 sound/virtio/virtio_pcm_msg.c                 |  4 +-
 40 files changed, 111 insertions(+), 199 deletions(-)
Signature · 1 line
2.43.0