Skip to content

Deduplicate bin_attribute simple read() callbacks

Lukas Wunner linux-acpi linux-efi linux-modules linux-pm linuxppc-dev lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2sysfs: Add sysfs_bin_attr_simple_read() helperfs/sysfs/file.c include/linux/sysfs.h+42 -01 reply
2/2treewide: Use sysfs_bin_attr_simple_read() helperarch/powerpc/platforms/powernv/opal.c drivers/acpi/bgrt.c drivers/firmware/dmi_scan.c +5 more+14 -857 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchArd BiesheuvelZhi WangMichael EllermanRafael J. WysockiGreg Kroah-HartmanGuenter Roeck
SeriesA-b A-b
1/2R-b
2/2A-b A-b R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 6 reviewers.

Read the v1 thread

Cover letter [PATCH 0/2] Deduplicate bin_attribute simple read() callbacks

For my upcoming PCI device authentication v2 patches, I have the need to expose a simple buffer in virtual memory as a bin_attribute.

It turns out we've duplicated the ->read() callback for such simple buffers a fair number of times across the tree.

So instead of reinventing the wheel, I decided to introduce a common helper and eliminate all duplications I could find.

I'm open to a bikeshedding discussion on the sysfs_bin_attr_simple_read() name. ;)

Lukas Wunner (2):
sysfs: Add sysfs_bin_attr_simple_read() helper
treewide: Use sysfs_bin_attr_simple_read() helper

 arch/powerpc/platforms/powernv/opal.c              | 10 +-------
 drivers/acpi/bgrt.c                                |  9 +-------
 drivers/firmware/dmi_scan.c                        | 12 ++--------
 drivers/firmware/efi/rci2-table.c                  | 10 +-------
 drivers/gpu/drm/i915/gvt/firmware.c                | 26 +++++----------------
 .../intel/int340x_thermal/int3400_thermal.c        |  9 +-------
 fs/sysfs/file.c                                    | 27 ++++++++++++++++++++++
 include/linux/sysfs.h                              | 15 ++++++++++++
 init/initramfs.c                                   | 10 +-------
 kernel/module/sysfs.c                              | 13 +----------
 10 files changed, 56 insertions(+), 85 deletions(-)
Signature · 1 line
2.43.0