Skip to content

RFC driver core: constify groups arrays in several structs

Heiner Kallweit driver-core linux-rdma linux-rtc lkml llvm oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest10 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10IB/core: Prepare for immutable device groupsdrivers/infiniband/core/device.c+4 -51 reply
2/10rtc: prepare for struct device member groups becoming a constant arraydrivers/rtc/sysfs.c+4 -42 replies
3/10sysfs: constify group arrays in function argumentsfs/sysfs/group.c include/linux/sysfs.h+13 -130 replies
4/10driver: core: constify groups array argument in device_add_groups and device_remove_groupsdrivers/base/core.c include/linux/device.h+5 -40 replies
5/10driver core: make struct device member groups a constant arrayinclude/linux/device.h+1 -10 replies
6/10driver core: make struct device_type member groups a constant arrayinclude/linux/device.h+1 -10 replies
7/10driver core: make struct bus_type groups members constant arraysdrivers/base/base.h drivers/base/driver.c include/linux/device/bus.h+9 -70 replies
8/10driver core: make struct class groups members constant arraysinclude/linux/device/class.h+2 -20 replies
9/10driver core: make struct device_driver groups members contact arraysinclude/linux/device/driver.h+2 -20 replies
10/10kobject: make struct kobject member default_groups a constant arrayinclude/linux/kobject.h+1 -12 replies

Reviews trailers per patch

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

PatchLeon RomanovskyAlexandre Belloni
1/10A-b
2/10A-b
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

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 RFC 00/10] driver core: constify groups arrays in several structs

This series constifies the attribute group groups arrays in a number of structs, plus some preparation work. This allows to assign constant arrays, w/o "discards const qualifier" compiler warning. This is a step towards to goal to e.g. create constant arrays in macro __ATTRIBUTE_GROUPS().

There may be drivers not covered by my test scenarios which conflict with this series. Therefore I send it as RFC for now. Hopefully some CI checking this series provides additional hints.

Heiner Kallweit (10):
IB/core: Prepare for immutable device groups
rtc: prepare for struct device member groups becoming a constant array
sysfs: constify group arrays in function arguments
driver: core: constify groups array argument in device_add_groups and
device_remove_groups
driver core: make struct device member groups a constant array driver core: make struct device_type member groups a constant array driver core: make struct bus_type groups members constant arrays driver core: make struct class groups members constant arrays driver core: make struct device_driver groups members contact arrays
kobject: make struct kobject member default_groups a constant array

 drivers/base/base.h              |  6 ++++--
 drivers/base/core.c              |  5 +++--
 drivers/base/driver.c            |  4 ++--
 drivers/infiniband/core/device.c |  9 ++++-----
 drivers/rtc/sysfs.c              |  8 ++++----
 fs/sysfs/group.c                 | 10 +++++-----
 include/linux/device.h           |  8 ++++----
 include/linux/device/bus.h       |  6 +++---
 include/linux/device/class.h     |  4 ++--
 include/linux/device/driver.h    |  4 ++--
 include/linux/kobject.h          |  2 +-
 include/linux/sysfs.h            | 16 ++++++++--------
 12 files changed, 42 insertions(+), 40 deletions(-)
Signature · 1 line
2.53.0