linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/7] sysfs: prepare the constification of struct attribute
@ 2025-08-11  9:14 Thomas Weißschuh
  2025-08-11  9:14 ` [PATCH v3 1/7] sysfs: attribute_group: allow registration of const attribute Thomas Weißschuh
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: Thomas Weißschuh @ 2025-08-11  9:14 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
  Cc: linux-kernel, Thomas Weißschuh

The migration of 'struct attribute' and its related structures and
macros are more complicated than those for 'struct bin_attribute'.
Mostly because they are all shared by various custom attribute types.
Introduce some initial utilities to support the migration.
These are enough to migrate some specialized attributes atomically or
those which don't use 'struct attribute' in their callbacks stepwise.

The big outstanding problems are 'struct device_attribute' and
'struct kobj_attribute'. These are used everywhere and I'm not yet sure
about a migration plan.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
Changes in v3:
- Rebase von v6.17-rc1
- Link to v2: https://lore.kernel.org/r/20250629-sysfs-const-attr-prep-v2-0-9ec5fe39083f@weissschuh.net

Changes in v2:
- Rebase onto driver-core-next
- Simplify attribute macro definitions
- +Cc Danilo
- Link to v1: https://lore.kernel.org/r/20250116-sysfs-const-attr-prep-v1-0-15e72dba4205@weissschuh.net

---
Thomas Weißschuh (7):
      sysfs: attribute_group: allow registration of const attribute
      sysfs: transparently handle const pointers in ATTRIBUTE_GROUPS()
      sysfs: introduce __SYSFS_FUNCTION_ALTERNATIVE()
      sysfs: attribute_group: enable const variants of is_visible()
      samples/kobject: add is_visible() callback to attribute group
      samples/kobject: constify 'struct foo_attribute'
      sysfs: simplify attribute definition macros

 fs/sysfs/group.c               | 10 +++++++--
 include/linux/sysfs.h          | 48 +++++++++++++++++++++++++-----------------
 samples/kobject/kset-example.c | 44 ++++++++++++++++++++++++++------------
 3 files changed, 67 insertions(+), 35 deletions(-)
---
base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
change-id: 20250114-sysfs-const-attr-prep-e9414982dc4f

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


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

end of thread, other threads:[~2025-08-19 14:15 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-11  9:14 [PATCH v3 0/7] sysfs: prepare the constification of struct attribute Thomas Weißschuh
2025-08-11  9:14 ` [PATCH v3 1/7] sysfs: attribute_group: allow registration of const attribute Thomas Weißschuh
2025-08-19 11:22   ` Greg Kroah-Hartman
2025-08-19 13:59     ` Thomas Weißschuh
2025-08-19 14:10       ` Greg Kroah-Hartman
2025-08-19 14:15         ` Thomas Weißschuh
2025-08-11  9:14 ` [PATCH v3 2/7] sysfs: transparently handle const pointers in ATTRIBUTE_GROUPS() Thomas Weißschuh
2025-08-11  9:14 ` [PATCH v3 3/7] sysfs: introduce __SYSFS_FUNCTION_ALTERNATIVE() Thomas Weißschuh
2025-08-11  9:14 ` [PATCH v3 4/7] sysfs: attribute_group: enable const variants of is_visible() Thomas Weißschuh
2025-08-19 11:28   ` Greg Kroah-Hartman
2025-08-19 14:07     ` Thomas Weißschuh
2025-08-11  9:14 ` [PATCH v3 5/7] samples/kobject: add is_visible() callback to attribute group Thomas Weißschuh
2025-08-19 11:24   ` Greg Kroah-Hartman
2025-08-19 14:00     ` Thomas Weißschuh
2025-08-11  9:14 ` [PATCH v3 6/7] samples/kobject: constify 'struct foo_attribute' Thomas Weißschuh
2025-08-19 11:27   ` Greg Kroah-Hartman
2025-08-11  9:14 ` [PATCH v3 7/7] sysfs: simplify attribute definition macros Thomas Weißschuh
2025-08-12 14:36 ` [PATCH v3 0/7] sysfs: prepare the constification of struct attribute Greg Kroah-Hartman

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