The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v3 0/6] sysfs: finalize the constification of 'struct bin_attribute'
@ 2025-05-30  3:54 Thomas Weißschuh
  2025-05-30  3:54 ` [PATCH v3 1/6] const_structs.checkpatch: add bin_attribute Thomas Weißschuh
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Thomas Weißschuh @ 2025-05-30  3:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
  Cc: linux-kernel, Thomas Weißschuh

All users have been migrated to the new const types.
Change the types of the normal fields, switch all users over and then
get rid of the transition machinery.

The treewide changes have been done with sed/grep.
Based on top of next-20250528.
Meant to be applied around the end of the merge window.
As it is not clear what goes into the merge window this is done on
linux-next. Applying it will probably create some trivially to resolve
conflicts.

After applying, make sure no leftovers are left:
$ git grep bin_attrs_new
$ git grep read_new ':!drivers/block/swim_asm.S'
$ git grep write_new ':!drivers/cpufreq/powernow-k8.c' ':!drivers/s390/char/monwriter.c'

I'm only sending this to the sysfs maintainers. The treewide changes are
purely mechanical.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
Changes in v3:
- Drop already applied patches
- Constify internal references in fs/sysfs/file.c
- Update const_structs.checkpatch
- Rebase on linux-next/master
- Link to v2: https://lore.kernel.org/r/20250313-sysfs-const-bin_attr-final-v2-0-96284e1e88ce@weissschuh.net

Changes in v2:
- Rebase onto current driver-core-next.
- Remove prerequisites list from cover letter.
- Link to v1: https://lore.kernel.org/r/20250219-sysfs-const-bin_attr-final-v1-0-02828d86af3c@weissschuh.net

---
Thomas Weißschuh (6):
      const_structs.checkpatch: add bin_attribute
      sysfs: constify internal references to 'struct bin_attribute'
      sysfs: treewide: switch back to bin_attribute::read()/write()
      sysfs: treewide: switch back to attribute_group::bin_attrs
      sysfs: remove bin_attribute::read_new/write_new()
      sysfs: remove attribute_group::bin_attrs_new

 arch/powerpc/kernel/secvar-sysfs.c                 |  2 +-
 arch/powerpc/perf/hv-24x7.c                        |  2 +-
 arch/powerpc/platforms/powernv/opal-core.c         |  4 +--
 arch/powerpc/platforms/powernv/opal-dump.c         |  2 +-
 arch/powerpc/platforms/powernv/opal-elog.c         |  2 +-
 arch/powerpc/platforms/powernv/opal-flash.c        |  2 +-
 arch/powerpc/platforms/powernv/opal-msglog.c       |  2 +-
 arch/powerpc/platforms/powernv/opal.c              |  2 +-
 arch/powerpc/platforms/powernv/ultravisor.c        |  2 +-
 arch/s390/kernel/cpacf.c                           |  2 +-
 arch/s390/kernel/ipl.c                             | 18 ++++++------
 arch/s390/pci/pci_sysfs.c                          |  2 +-
 arch/x86/kernel/ksysfs.c                           |  8 ++---
 drivers/accel/habanalabs/common/sysfs.c            |  4 +--
 drivers/acpi/bgrt.c                                |  2 +-
 drivers/acpi/sysfs.c                               |  4 +--
 drivers/base/devcoredump.c                         |  2 +-
 drivers/base/firmware_loader/sysfs.c               |  6 ++--
 drivers/base/node.c                                |  2 +-
 drivers/base/topology.c                            |  2 +-
 drivers/cxl/port.c                                 |  2 +-
 drivers/firmware/efi/mokvar-table.c                |  2 +-
 drivers/firmware/google/cbmem.c                    |  2 +-
 drivers/firmware/google/gsmi.c                     |  2 +-
 drivers/firmware/google/memconsole.c               |  2 +-
 drivers/firmware/google/vpd.c                      |  4 +--
 drivers/firmware/qemu_fw_cfg.c                     |  2 +-
 drivers/fsi/fsi-core.c                             |  4 +--
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c            |  6 ++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c            |  2 +-
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c |  4 +--
 drivers/gpu/drm/drm_sysfs.c                        |  4 +--
 drivers/gpu/drm/i915/i915_gpu_error.c              |  4 +--
 drivers/gpu/drm/i915/i915_sysfs.c                  |  8 ++---
 drivers/gpu/drm/lima/lima_drv.c                    |  4 +--
 drivers/hid/hid-core.c                             |  2 +-
 drivers/hid/hid-roccat-arvo.c                      |  2 +-
 drivers/hid/hid-roccat-common.h                    |  8 ++---
 drivers/hid/hid-roccat-isku.c                      | 10 +++----
 drivers/hid/hid-roccat-kone.c                      |  6 ++--
 drivers/hid/hid-roccat-koneplus.c                  | 14 ++++-----
 drivers/hid/hid-roccat-konepure.c                  |  2 +-
 drivers/hid/hid-roccat-kovaplus.c                  | 12 ++++----
 drivers/hid/hid-roccat-lua.c                       |  4 +--
 drivers/hid/hid-roccat-pyra.c                      | 14 ++++-----
 drivers/hid/hid-roccat-ryos.c                      |  2 +-
 drivers/hid/hid-roccat-savu.c                      |  2 +-
 drivers/i2c/i2c-slave-eeprom.c                     |  4 +--
 drivers/iio/imu/bno055/bno055.c                    |  2 +-
 drivers/infiniband/hw/hfi1/sysfs.c                 |  2 +-
 drivers/infiniband/hw/qib/qib_sysfs.c              |  2 +-
 drivers/input/touchscreen/goodix_berlin_core.c     |  2 +-
 drivers/leds/led-class.c                           |  2 +-
 drivers/media/pci/solo6x10/solo6x10-core.c         |  2 +-
 drivers/misc/c2port/core.c                         |  2 +-
 drivers/misc/ds1682.c                              |  4 +--
 drivers/misc/eeprom/max6875.c                      |  2 +-
 drivers/misc/ocxl/sysfs.c                          |  2 +-
 drivers/misc/pch_phub.c                            |  4 +--
 drivers/misc/sram.c                                |  4 +--
 drivers/mtd/spi-nor/sysfs.c                        |  2 +-
 .../net/ethernet/qlogic/netxen/netxen_nic_main.c   | 10 +++----
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c  | 34 +++++++++++-----------
 drivers/net/phy/spi_ks8995.c                       |  4 +--
 drivers/net/wireless/ti/wlcore/sysfs.c             |  2 +-
 drivers/nvmem/core.c                               | 14 ++++-----
 drivers/of/kobj.c                                  |  2 +-
 drivers/pci/hotplug/acpiphp_ibm.c                  |  2 +-
 drivers/pci/p2pdma.c                               |  2 +-
 drivers/pci/pci-sysfs.c                            | 12 ++++----
 drivers/pci/vpd.c                                  |  2 +-
 drivers/pcmcia/cistpl.c                            |  4 +--
 drivers/platform/chrome/cros_ec_vbc.c              |  2 +-
 drivers/platform/mellanox/mlxbf-bootctl.c          |  2 +-
 drivers/platform/x86/amd/hsmp/acpi.c               |  4 +--
 drivers/platform/x86/amd/hsmp/plat.c               |  4 +--
 drivers/platform/x86/dell/dcdbas.c                 |  2 +-
 drivers/platform/x86/dell/dell_rbu.c               |  2 +-
 drivers/platform/x86/intel/pmt/class.c             |  2 +-
 drivers/platform/x86/intel/sdsi.c                  |  2 +-
 drivers/platform/x86/wmi-bmof.c                    |  2 +-
 drivers/power/supply/ds2760_battery.c              |  2 +-
 drivers/power/supply/ds2780_battery.c              | 10 +++----
 drivers/power/supply/ds2781_battery.c              | 10 +++----
 drivers/power/supply/olpc_battery.c                |  4 +--
 drivers/ptp/ptp_ocp.c                              |  2 +-
 drivers/rapidio/rio-sysfs.c                        |  6 ++--
 drivers/s390/char/sclp_config.c                    |  2 +-
 drivers/s390/char/sclp_sd.c                        |  2 +-
 drivers/s390/cio/chp.c                             |  2 +-
 drivers/s390/crypto/pkey_sysfs.c                   |  8 ++---
 drivers/scsi/3w-sas.c                              |  4 +--
 drivers/scsi/arcmsr/arcmsr_attr.c                  |  6 ++--
 drivers/scsi/esas2r/esas2r_main.c                  |  6 ++--
 drivers/scsi/ibmvscsi/ibmvfc.c                     |  2 +-
 drivers/scsi/ipr.c                                 | 10 +++----
 drivers/scsi/lpfc/lpfc_attr.c                      |  8 ++---
 drivers/scsi/qedf/qedf_attr.c                      |  4 +--
 drivers/scsi/qla2xxx/qla_attr.c                    | 28 +++++++++---------
 drivers/scsi/qla4xxx/ql4_attr.c                    |  4 +--
 drivers/scsi/scsi_sysfs.c                          |  6 ++--
 drivers/usb/core/sysfs.c                           |  2 +-
 drivers/usb/usbip/vudc_sysfs.c                     |  2 +-
 drivers/video/fbdev/aty/radeon_base.c              |  4 +--
 drivers/video/fbdev/udlfb.c                        |  4 +--
 drivers/virt/coco/guest/tsm-mr.c                   |  8 ++---
 drivers/w1/slaves/w1_ds2406.c                      |  4 +--
 drivers/w1/slaves/w1_ds2408.c                      |  2 +-
 drivers/w1/slaves/w1_ds2413.c                      |  2 +-
 drivers/w1/slaves/w1_ds2430.c                      |  2 +-
 drivers/w1/slaves/w1_ds2431.c                      |  2 +-
 drivers/w1/slaves/w1_ds2433.c                      | 12 ++++----
 drivers/w1/slaves/w1_ds2438.c                      |  2 +-
 drivers/w1/slaves/w1_ds2780.c                      |  2 +-
 drivers/w1/slaves/w1_ds2781.c                      |  2 +-
 drivers/w1/slaves/w1_ds2805.c                      |  4 +--
 drivers/w1/slaves/w1_ds28e04.c                     |  2 +-
 drivers/w1/w1.c                                    |  2 +-
 drivers/zorro/zorro-sysfs.c                        |  4 +--
 fs/sysfs/file.c                                    | 32 +++++++-------------
 include/linux/sysfs.h                              | 11 ++-----
 kernel/bpf/btf.c                                   |  2 +-
 kernel/bpf/sysfs_btf.c                             |  2 +-
 kernel/module/sysfs.c                              | 14 ++++-----
 mm/page_idle.c                                     |  2 +-
 net/bridge/br_sysfs_br.c                           |  2 +-
 scripts/const_structs.checkpatch                   |  1 +
 127 files changed, 292 insertions(+), 310 deletions(-)
---
base-commit: 2a628f951ed54c30a232230b5b58349d2a8dbb11
change-id: 20250217-sysfs-const-bin_attr-final-d9e4d0cf8a1d

Best regards,
-- 
Thomas Weißschuh <linux@weissschuh.net>


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

end of thread, other threads:[~2025-06-18 10:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-30  3:54 [PATCH v3 0/6] sysfs: finalize the constification of 'struct bin_attribute' Thomas Weißschuh
2025-05-30  3:54 ` [PATCH v3 1/6] const_structs.checkpatch: add bin_attribute Thomas Weißschuh
2025-05-30  3:54 ` [PATCH v3 2/6] sysfs: constify internal references to 'struct bin_attribute' Thomas Weißschuh
2025-05-30  3:54 ` [PATCH v3 3/6] sysfs: treewide: switch back to bin_attribute::read()/write() Thomas Weißschuh
2025-05-30  3:54 ` [PATCH v3 4/6] sysfs: treewide: switch back to attribute_group::bin_attrs Thomas Weißschuh
2025-05-30  3:54 ` [PATCH v3 5/6] sysfs: remove bin_attribute::read_new/write_new() Thomas Weißschuh
2025-05-30  3:54 ` [PATCH v3 6/6] sysfs: remove attribute_group::bin_attrs_new Thomas Weißschuh
2025-06-14  6:23 ` [PATCH v3 0/6] sysfs: finalize the constification of 'struct bin_attribute' Thomas Weißschuh
2025-06-17  8:48   ` Greg Kroah-Hartman
2025-06-17 14:06     ` Thomas Weißschuh
2025-06-18  7:50       ` Greg Kroah-Hartman
2025-06-18 10:46         ` Thomas Weißschuh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox