]> git.ipfire.org Git - thirdparty/linux.git/commit
sysfs/cpu: Use DEVICE_ATTR_RO for nohz_full attribute
authorAaron Tomlin <atomlin@atomlin.com>
Sat, 11 Oct 2025 01:18:29 +0000 (21:18 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Nov 2025 14:20:49 +0000 (15:20 +0100)
commit76987bac71d5349a62f312ca1cd92de73778a652
tree45e5935743cd197cfa26e02a4a3e483f11f06ffa
parent382b1e8f30f779af8d6d33268e53df7de579ef3c
sysfs/cpu: Use DEVICE_ATTR_RO for nohz_full attribute

The /sys/devices/system/cpu/nohz_full file is a read-only attribute that
reports the CPUs configured for tickless operation (CONFIG_NO_HZ_FULL=y).

The current definition uses the generic DEVICE_ATTR macro, which
unnecessarily requires specifying the file mode (0444) and a NULL
store operation pointer.

This patch converts the definition to use the dedicated DEVICE_ATTR_RO
macro. This correctly expresses the read-only nature of the attribute,
removes the redundant mode field, and simplifies the code. As a related
cleanup, rename the show function from print_cpus_nohz_full() to the
standard nohz_full_show() for consistency with common sysfs attribute
naming conventions.

Signed-off-by: Aaron Tomlin <atomlin@atomlin.com>
Link: https://patch.msgid.link/20251011011830.6670-2-atomlin@atomlin.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/cpu.c