Re: [PATCH] docs: sysfs: Align example callback names with __ATTR_RW
From: Jonathan Corbet
Date: Wed Nov 25 2026 - 11:38:49 EST
Mauro Codella <mauro.codella@xxxxx> writes:
> The sysfs guide presents __ATTR_RW(foo) as a shorthand for the preceding
> DEVICE_ATTR declaration and explicit struct device_attribute initializer.
> Both preceding examples use show_foo and store_foo, but __ATTR_RW(_name)
> uses token pasting with _name##_show and _name##_store, so __ATTR_RW(foo)
> references foo_show and foo_store instead. Switching to the shorthand
> without renaming the callbacks would fail to compile.
>
> Rename the callbacks in both preceding examples to foo_show and foo_store
> so all three examples agree. No kernel behavior is changed.
>
> Codex identified the mismatch and assisted with the change and commit
> message after a request to find a small kernel contribution.
>
> Fixes: 44a47f0e3ec2 ("sysfs.txt: add note on available attribute macros")
> Signed-off-by: Mauro Codella <mauro.codella@xxxxx>
> ---
> Documentation/filesystems/sysfs.rst | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Applied, thanks.
jon