Re: [PATCH 3/3] hwmon: (sysfs) Allow drivers to register const attributes

[email protected] Wed, 05 Aug 2026 20:07:54 +0000
Newsgroups org.kernel.vger.linux-hwmon
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The commit message incorrectly states that the patch switches to the `__DRIVER_ATTR()` macro, while the code actually switches to the `__DEVICE_ATTR()` macro.
--

--- Patch [3]: [PATCH 3/3] hwmon: (sysfs) Allow drivers to register const attributes ---
commit 91e4cdd2e4ad9f4eaa7572f21133759d5e925d9e
Author: Thomas Weißschuh <[email protected]>

hwmon: (sysfs) Allow drivers to register const attributes

This commit updates the hwmon-sysfs macros to use container_of_const() and
__DEVICE_ATTR(). This change supports callbacks taking both const and
non-const attribute arguments, allowing for a step-wise migration of drivers.

> Switch to the __DRIVER_ATTR() macro which can handle callbacks taking
> both const and non-const attribute structure arguments.

[Severity: Low]
This isn't a bug, but the commit message states the patch switches to the
__DRIVER_ATTR() macro. However, the code actually switches to the
__DEVICE_ATTR() macro:

include/linux/hwmon-sysfs.h:SENSOR_ATTR()
    { .dev_attr = __DEVICE_ATTR(_name, _mode, _show, _store),

Could the commit message be updated to accurately reflect the macro used in
the code?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3