]> git.ipfire.org Git - thirdparty/linux.git/commit
sysfs: simplify attribute definition macros
authorThomas Weißschuh <linux@weissschuh.net>
Wed, 29 Oct 2025 08:12:16 +0000 (09:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Nov 2025 14:16:35 +0000 (15:16 +0100)
commit71464949b1f5f8b8599d057fea525a2a520f84d8
tree8c5137f97f58741f878e52d4e130180c8aceec38
parent2d76fdc1c91a95c23cd3e47a4fd4315f1633019b
sysfs: simplify attribute definition macros

Define the macros in terms of each other.
This makes them easier to understand and also will make it easier to
implement the transition machinery for 'const struct attribute'.

__ATTR_RO_MODE() can't be implemented in terms of __ATTR() as not all
attributes have a .store callback. The same issue theoretically exists
for __ATTR_WO(), but practically that does not occur today.

Reorder __ATTR_RO() below __ATTR_RO_MODE() to keep the order of the
macro definition consistent with respect to each other.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://patch.msgid.link/20251029-sysfs-const-attr-prep-v5-7-ea7d745acff4@weissschuh.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/sysfs.h