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

Guenter Roeck <[email protected]> Wed, 5 Aug 2026 14:20:05 -0700
Newsgroups org.kernel.vger.linux-hwmon,dev.linux.lists.sashiko-reviews
Message-ID <[email protected]>
On 8/5/26 13:07, [email protected] wrote:
> 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.
> --
> 

I see no evidence that __DRIVER_ATTR actually exists anywhere ...

Guenter

> --- 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?
>