Skip to content

driver core: class: allow struct class to be static

Greg Kroah-Hartman lkml 1 version In review

Get series with b4
b4 am 2023040244-duffel-pushpin-f738@gregkh

Versions newest first

  1. v1 Latest5 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5driver core: class: mark class_release() as taking a const *drivers/base/class.c drivers/pcmcia/cs.c include/linux/device/class.h+3 -31 reply
2/5driver core: class: make class_register() take a const *drivers/base/base.h drivers/base/class.c include/linux/device/class.h+5 -51 reply
3/5driver core: class: mark the struct class in struct class_interface constantdrivers/base/class.c include/linux/device/class.h+2 -21 reply
4/5driver core: class: remove struct class_interface * from callbacksdrivers/base/class.c drivers/base/core.c drivers/hwmon/drivetemp.c +10 more+28 -473 replies
5/5tty: make tty_class a static const structuredrivers/tty/pty.c drivers/tty/tty_io.c drivers/tty/vt/vt.c +1 more+14 -161 reply

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchJiri SlabyLogan GunthorpeRafael J. WysockiGuenter Roeck
1/5A-b
2/5A-b
3/5A-b
4/5A-b A-b A-b
5/5R-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 4 reviewers.

Read the v1 thread

Cover letter [PATCH 0/5] driver core: class: allow struct class to be static

There's been a semi-slow drip of driver core struct class changes recently, and here's the final bit to the core that makes it possible for 'struct class' to be moved into read-only memory. And as proof, the last patch in the series does just that for the tty classes.

After this series, there's some tree-wide cleanups needed to move away from the class_create() api back to class_register() to move the structures into read-only memory. The class_create() api was a good idea when it was created (as struct class was a dynamic structure), but that got changed a long time ago and that's not necessary anymore. But that can wait for after 6.4-rc1 is out as they can all go through the different relevant subsystems if wanted.

All of these apply on top of my latest driver-core.git driver-core-next branch (or linux-next), as they require the current set of struct class and struct bus_type reworks and have been tested locally (I'm typing this and will send them out on a kernel running these changes).

Greg Kroah-Hartman (5):
driver core: class: mark class_release() as taking a const * driver core: class: make class_register() take a const * driver core: class: mark the struct class in struct class_interface
constant
driver core: class: remove struct class_interface * from callbacks
tty: make tty_class a static const structure

 drivers/base/base.h                      |  2 +-
 drivers/base/class.c                     | 14 +++++++-------
 drivers/base/core.c                      | 10 ++++------
 drivers/hwmon/drivetemp.c                |  4 ++--
 drivers/net/rionet.c                     |  3 +--
 drivers/ntb/hw/mscc/ntb_hw_switchtec.c   |  6 ++----
 drivers/pcmcia/cs.c                      |  2 +-
 drivers/pcmcia/ds.c                      |  6 ++----
 drivers/pcmcia/rsrc_nonstatic.c          |  6 ++----
 drivers/rapidio/devices/rio_mport_cdev.c |  7 ++-----
 drivers/rapidio/rio_cm.c                 |  8 ++------
 drivers/scsi/ses.c                       |  6 ++----
 drivers/scsi/sg.c                        |  8 ++++----
 drivers/tty/pty.c                        |  2 +-
 drivers/tty/tty_io.c                     | 24 +++++++++++-------------
 drivers/tty/vt/vt.c                      |  2 +-
 include/linux/device/class.h             | 10 +++++-----
 include/linux/tty.h                      |  2 +-
 kernel/time/alarmtimer.c                 |  3 +--
 19 files changed, 52 insertions(+), 73 deletions(-)
Signature · 1 line
2.40.0