ACPI: sysfs: use sysfs_emit() to instead of scnprintf()
PATCH 1/1 ACPI: sysfs: use sysfs_emit() to instead of scnprintf()
From: Xu Panda <[email protected]>
Replace scnprintf() with sysfs_emit() to simplify the code.
Reported-by Zeal Robot <[email protected]>
Signed-off-by Xu Panda <[email protected]>
Signed-off-by Yang Yang <[email protected]>
--- drivers/acpi/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/sysfs.c +1 -1
@@ -198,7 +198,7 @@ static int param_set_trace_method_name(const char *val,static int param_get_trace_method_name (char *buffer,const struct kernel_param *kp) { -return scnprintf (buffer,PAGE_SIZE ,"%s\n" , acpi_gbl_trace_method_name); +return sysfs_emit (buffer,"%s\n" , acpi_gbl_trace_method_name); }static const struct kernel_param_ops param_ops_trace_method = {
Signature · 1 line
2.15.2
Quoted 17 lines · On Wed, Nov 9, 2022 at 2:25 PM <[email protected]> wrote:
From: Xu Panda <[email protected]>
Replace
scnprintf()withsysfs_emit()to simplify the code.Reported-by Zeal Robot <[email protected]>Signed-off-by Xu Panda <[email protected]>Signed-off-by Yang Yang <[email protected]>--- drivers/acpi/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/acpi/sysfs.c +0
-0
drivers/acpi/sysfs.c static int param_set_trace_method_name(const char *val,
Quoted 9 lines
drivers/acpi/sysfs.c +1
-2@@ -198,7 +198,7 @@ static int param_set_trace_method_name(const char *val,static int param_get_trace_method_name (char *buffer,const struct kernel_param *kp) { -return scnprintf (buffer,PAGE_SIZE ,"%s\n" , acpi_gbl_trace_method_name); +return sysfs_emit (buffer,"%s\n" , acpi_gbl_trace_method_name); }static const struct kernel_param_ops param_ops_trace_method = { --
Applied as 6.2 material, thanks!