mbox series

[v3,0/2] Use sysfs_emit() and sysfs_emit_at() in "show" functions

Message ID 20240801083156.2513508-1-luoxueqin@kylinos.cn
Headers show
Series Use sysfs_emit() and sysfs_emit_at() in "show" functions | expand

Message

Xueqin Luo Aug. 1, 2024, 8:31 a.m. UTC
As Documentation/filesystems/sysfs.rst suggested,
show() should only use sysfs_emit() or sysfs_emit_at() when formatting
the value to be returned to user space.

No functional change intended.

v3: Changed code style as suggested by Rafael J. Wysockid, thanks!

v2: Adopted Christophe's suggestions as follows:
- Fixed some formatting
- Fixed logic errors in mem_sleep_show, pm_test_show, state_show functions
Thanks!

Xueqin Luo (2):
  PM: hibernate: Use sysfs_emit() and sysfs_emit_at() in "show"
    functions
  PM: Use sysfs_emit() and sysfs_emit_at() in "show" functions

 kernel/power/hibernate.c | 22 +++++------
 kernel/power/main.c      | 82 ++++++++++++++++++++++------------------
 2 files changed, 56 insertions(+), 48 deletions(-)

Comments

Rafael J. Wysocki Aug. 2, 2024, 2:05 p.m. UTC | #1
On Thu, Aug 1, 2024 at 10:32 AM Xueqin Luo <luoxueqin@kylinos.cn> wrote:
>
> As Documentation/filesystems/sysfs.rst suggested,
> show() should only use sysfs_emit() or sysfs_emit_at() when formatting
> the value to be returned to user space.
>
> No functional change intended.
>
> v3: Changed code style as suggested by Rafael J. Wysockid, thanks!
>
> v2: Adopted Christophe's suggestions as follows:
> - Fixed some formatting
> - Fixed logic errors in mem_sleep_show, pm_test_show, state_show functions
> Thanks!
>
> Xueqin Luo (2):
>   PM: hibernate: Use sysfs_emit() and sysfs_emit_at() in "show"
>     functions
>   PM: Use sysfs_emit() and sysfs_emit_at() in "show" functions
>
>  kernel/power/hibernate.c | 22 +++++------
>  kernel/power/main.c      | 82 ++++++++++++++++++++++------------------
>  2 files changed, 56 insertions(+), 48 deletions(-)
>
> --

Both patches applied as 6.12 material, thanks!