ACPI: sysfs: use sysfs_emit() to instead of scnprintf()

Replace scnprintf() with sysfs_emit() to simplify the code.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Xu Panda <xu.panda@zte.com.cn>
Signed-off-by: Yang Yang <yang.yang29@zte.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Xu Panda 2022-11-09 21:25:25 +08:00 committed by Rafael J. Wysocki
parent 4612c7f138
commit 82d08d61e3

View File

@ -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 = {