]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
driver core: add missing kernel-doc for union members
authorRandy Dunlap <rdunlap@infradead.org>
Tue, 23 Jun 2026 19:00:22 +0000 (12:00 -0700)
committerDanilo Krummrich <dakr@kernel.org>
Sun, 28 Jun 2026 22:59:24 +0000 (00:59 +0200)
The use of __SYSFS_FUNCTION_ALTERNATIVE() adds an anonymous union (or
struct if CONFIG_CFI=y).*

Describe the additional struct/union members to avoid docs build
warnings.

Warning: include/linux/device.h:117 struct member 'show_const' not described in 'device_attribute'
Warning: include/linux/device.h:117 struct member 'store_const' not described in 'device_attribute'

*: kernel-doc ignores CONFIG_ symbols in source files; it is using the
first definition of __SYSFS_FUNCTION_ALTERNATIVE(), which is struct
instead of union.

Fixes: 434506b86a6c ("driver core: Allow the constification of device attributes")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://patch.msgid.link/20260623190023.407781-1-rdunlap@infradead.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
include/linux/device.h

index 7b2baffdd2f55f234ce844f6b24c9283ac70e6b9..aee79fd6b32b470433407e46d3c330ee83c4f97c 100644 (file)
@@ -99,7 +99,9 @@ struct device_type {
  * struct device_attribute - Interface for exporting device attributes.
  * @attr: sysfs attribute definition.
  * @show: Show handler.
+ * @show_const: Show handler (read-only).
  * @store: Store handler.
+ * @store_const: Store handler (read-only).
  */
 struct device_attribute {
        struct attribute        attr;