linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Deduplicate bin_attribute simple read() callbacks
@ 2024-04-06 13:52 Lukas Wunner
  2024-04-06 13:52 ` [PATCH 1/2] sysfs: Add sysfs_bin_attr_simple_read() helper Lukas Wunner
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Lukas Wunner @ 2024-04-06 13:52 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, linux-kernel
  Cc: Michael Ellerman, linuxppc-dev, linux-acpi, Jean Delvare,
	Ard Biesheuvel, linux-efi, Zhenyu Wang, Zhi Wang, intel-gvt-dev,
	Daniel Lezcano, linux-pm, Luis Chamberlain, linux-modules

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(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-04-11 13:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-06 13:52 [PATCH 0/2] Deduplicate bin_attribute simple read() callbacks Lukas Wunner
2024-04-06 13:52 ` [PATCH 1/2] sysfs: Add sysfs_bin_attr_simple_read() helper Lukas Wunner
2024-04-11 13:07   ` Greg Kroah-Hartman
2024-04-06 13:52 ` [PATCH 2/2] treewide: Use " Lukas Wunner
2024-04-08 10:42   ` Zhi Wang
2024-04-08 11:11   ` Michael Ellerman
2024-04-08  8:42 ` [PATCH 0/2] Deduplicate bin_attribute simple read() callbacks Ard Biesheuvel
2024-04-08 15:01 ` Rafael J. Wysocki
2024-04-11 13:07 ` Greg Kroah-Hartman
2024-04-11 13:39   ` Lukas Wunner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).