docs: filesystems: sysfs: Recommend sysfs_emit() for new code only
PATCH 1/1 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.
--- Documentation/filesystems/sysfs.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/filesystems/sysfs.rst +2 -2
@@ -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.
Quoted 5 lines · Bart Van Assche
The advantages of converting existing sysfs
show()methods tosysfs_emit()andsysfs_emit_at()do not outweigh the risk of introducing bugs. Hence recommendsysfs_emit()andsysfs_emit_at()only for new implementations ofshow()methods.
Quoted 7 lines
Cc Greg Kroah-Hartman <[email protected]>Cc James Bottomley <[email protected]>Cc Martin K. Petersen <[email protected]>Signed-off-by Bart Van Assche <[email protected]>--- Documentation/filesystems/sysfs.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Hi Bart!
Quoted 2 lines
--
show()should only usesysfs_emit()orsysfs_emit_at()when formatting
With my standards hat on: That's a "should", not a "shall". But I guess the "only" makes it sound slightly less optional.
Quoted 3 lines
+- New implementations of show() methods should only use sysfs_emit() or + sysfs_emit_at() when formatting the value to be returned to userspace.
Should we make this a "shall" for new implementations?
I'm fine either way.
Signature · 1 line
Martin K. Petersen
Quoted 18 lines · Bart Van Assche
The advantages of converting existing sysfs
show()methods tosysfs_emit()andsysfs_emit_at()do not outweigh the risk of introducing bugs. Hence recommendsysfs_emit()andsysfs_emit_at()only for new implementations ofshow()methods.Cc Greg Kroah-Hartman <[email protected]>Cc James Bottomley <[email protected]>Cc Martin K. Petersen <[email protected]>Signed-off-by Bart Van Assche <[email protected]>--- Documentation/filesystems/sysfs.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Documentation/filesystems/sysfs.rst +0
-0
Documentation/filesystems/sysfs.rst Other notes: · line 248
Quoted 8 lines
Documentation/filesystems/sysfs.rst +2
-2@@ -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