lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202211170934005278113@zte.com.cn>
Date:   Thu, 17 Nov 2022 09:34:00 +0800 (CST)
From:   <guo.ziliang@....com.cn>
To:     <rafael@...nel.org>
Cc:     <lenb@...nel.org>, <linux-acpi@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: [PATCH linux-next] ACPI: sysfs: use sysfs_emit() to instead of scnprintf()

From: guo ziliang <guo.ziliang@....com.cn>

Replace the open-code with sysfs_emit() to simplify the code.

Signed-off-by: guo ziliang <guo.ziliang@....com.cn>
---
 drivers/acpi/sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c
index 2d81c74..7db3b53 100644
--- a/drivers/acpi/sysfs.c
+++ b/drivers/acpi/sysfs.c
@@ -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 = {
--
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ