mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-28 17:18:39 -05:00
docs: filesystems: sysfs: Recommend sysfs_emit() for new code only
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> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20250724153449.2433395-1-bvanassche@acm.org
This commit is contained in:
committed by
Jonathan Corbet
parent
1f590377eb
commit
2115dc3e33
@@ -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.
|
||||
|
||||
- store() should return the number of bytes used from the buffer. If the
|
||||
entire buffer has been used, just return the count argument.
|
||||
|
||||
Reference in New Issue
Block a user