mbox series

[0/6] Deduplicate string exposure in sysfs

Message ID cover.1713608122.git.lukas@wunner.de (mailing list archive)
Headers show
Series Deduplicate string exposure in sysfs | expand

Message

Lukas Wunner April 20, 2024, 8 p.m. UTC
Introduce a generic ->show() callback to expose a string as a device
attribute in sysfs.  Deduplicate various identical callbacks across
the tree.

Result:  Minus 216 LoC, minus 1576 bytes vmlinux size (x86_64 allyesconfig).

This is a byproduct of my upcoming PCI device authentication v2 patches.


Lukas Wunner (6):
  driver core: Add device_show_string() helper for sysfs attributes
  hwmon: Use device_show_string() helper for sysfs attributes
  IB/qib: Use device_show_string() helper for sysfs attributes
  perf: Use device_show_string() helper for sysfs attributes
  platform/x86: Use device_show_string() helper for sysfs attributes
  scsi: Use device_show_string() helper for sysfs attributes

 arch/powerpc/perf/hv-24x7.c              | 10 ----
 arch/x86/events/intel/core.c             | 13 ++---
 drivers/base/core.c                      |  9 ++++
 drivers/hwmon/i5k_amb.c                  | 15 ++----
 drivers/hwmon/ibmpex.c                   | 14 ++----
 drivers/infiniband/hw/qib/qib.h          |  1 -
 drivers/infiniband/hw/qib/qib_driver.c   |  6 ---
 drivers/infiniband/hw/qib/qib_sysfs.c    | 10 +---
 drivers/perf/alibaba_uncore_drw_pmu.c    | 12 +----
 drivers/perf/arm-cci.c                   | 12 +----
 drivers/perf/arm-ccn.c                   | 11 +----
 drivers/perf/arm_cspmu/arm_cspmu.c       | 10 ----
 drivers/perf/arm_cspmu/arm_cspmu.h       |  7 +--
 drivers/perf/arm_dsu_pmu.c               | 11 +----
 drivers/perf/cxl_pmu.c                   | 13 +----
 drivers/perf/hisilicon/hisi_pcie_pmu.c   | 13 +----
 drivers/perf/hisilicon/hisi_uncore_pmu.c | 14 ------
 drivers/perf/hisilicon/hisi_uncore_pmu.h |  4 +-
 drivers/perf/hisilicon/hns3_pmu.c        | 12 +----
 drivers/perf/qcom_l3_pmu.c               | 11 +----
 drivers/perf/xgene_pmu.c                 | 11 +----
 drivers/platform/x86/asus-wmi.c          | 62 ++++++------------------
 drivers/platform/x86/thinkpad_acpi.c     | 10 +---
 drivers/platform/x86/toshiba_acpi.c      |  9 +---
 drivers/scsi/bfa/bfad_attr.c             | 28 +++--------
 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 11 +----
 drivers/scsi/mvsas/mv_init.c             | 10 +---
 drivers/scsi/qla2xxx/qla_attr.c          | 11 +----
 drivers/scsi/smartpqi/smartpqi_init.c    | 11 ++---
 include/linux/device.h                   | 15 ++++++
 30 files changed, 85 insertions(+), 301 deletions(-)

Comments

Lukas Wunner May 4, 2024, 2:31 p.m. UTC | #1
Dear Greg,

On Sat, Apr 20, 2024 at 10:00:00PM +0200, Lukas Wunner wrote:
> Introduce a generic ->show() callback to expose a string as a device
> attribute in sysfs.  Deduplicate various identical callbacks across
> the tree.
> 
> Result:  Minus 216 LoC, minus 1576 bytes vmlinux size (x86_64 allyesconfig).
> 
> This is a byproduct of my upcoming PCI device authentication v2 patches.
> 
> 
> Lukas Wunner (6):
>   driver core: Add device_show_string() helper for sysfs attributes
>   hwmon: Use device_show_string() helper for sysfs attributes
>   IB/qib: Use device_show_string() helper for sysfs attributes
>   perf: Use device_show_string() helper for sysfs attributes
>   platform/x86: Use device_show_string() helper for sysfs attributes
>   scsi: Use device_show_string() helper for sysfs attributes

This series hasn't been applied to driver-core-next AFAICS and the
merge window is drawing closer.

So far only patches 1, 2 and 5 have been ack'ed by the respective
subsystem maintainers.  If the missing acks are the reason it hasn't
been applied, would it be possibe to apply only 1, 2 and 5?

I would then resubmit the other ones individually to the subsystem
maintainers in the next cycle.

Thanks!

Lukas
Greg Kroah-Hartman May 4, 2024, 3:36 p.m. UTC | #2
On Sat, May 04, 2024 at 04:31:42PM +0200, Lukas Wunner wrote:
> Dear Greg,
> 
> On Sat, Apr 20, 2024 at 10:00:00PM +0200, Lukas Wunner wrote:
> > Introduce a generic ->show() callback to expose a string as a device
> > attribute in sysfs.  Deduplicate various identical callbacks across
> > the tree.
> > 
> > Result:  Minus 216 LoC, minus 1576 bytes vmlinux size (x86_64 allyesconfig).
> > 
> > This is a byproduct of my upcoming PCI device authentication v2 patches.
> > 
> > 
> > Lukas Wunner (6):
> >   driver core: Add device_show_string() helper for sysfs attributes
> >   hwmon: Use device_show_string() helper for sysfs attributes
> >   IB/qib: Use device_show_string() helper for sysfs attributes
> >   perf: Use device_show_string() helper for sysfs attributes
> >   platform/x86: Use device_show_string() helper for sysfs attributes
> >   scsi: Use device_show_string() helper for sysfs attributes
> 
> This series hasn't been applied to driver-core-next AFAICS and the
> merge window is drawing closer.
> 
> So far only patches 1, 2 and 5 have been ack'ed by the respective
> subsystem maintainers.  If the missing acks are the reason it hasn't
> been applied, would it be possibe to apply only 1, 2 and 5?
> 
> I would then resubmit the other ones individually to the subsystem
> maintainers in the next cycle.

I'll just pick it up now, thanks!

greg k-h