Re: [PATCH] docs: filesystems: sysfs: Recommend sysfs_emit() for new code only
From: Jonathan Corbet <corbet@lwn.net>
Date: 2025-08-11 17:16:54
Bart Van Assche [off-list ref] writes:
quoted hunk ↗ jump to hunk
The advantages of converting existing sysfs show() methods to sysfs_emit() and sysfs_emit_at() do not outweigh the risk of introducing bugs. Hence recommend sysfs_emit() and sysfs_emit_at() only for new implementations of show() methods. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> --- Documentation/filesystems/sysfs.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)diff --git a/Documentation/filesystems/sysfs.rst b/Documentation/filesystems/sysfs.rst index c32993bc83c7..624e4f51212e 100644 --- a/Documentation/filesystems/sysfs.rst +++ b/Documentation/filesystems/sysfs.rst@@ -243,8 +243,8 @@ Other notes: - show() methods should return the number of bytes printed into the buffer. -- show() should only use sysfs_emit() or sysfs_emit_at() when formatting - the value to be returned to user space. +- New implementations of show() methods should only use sysfs_emit() or + sysfs_emit_at() when formatting the value to be returned to user space.
Applied, thanks. jon