public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: <yang.yang29@zte.com.cn>
To: <rafael@kernel.org>
Cc: <lenb@kernel.org>, <linux-acpi@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <xu.panda@zte.com.cn>,
	<yang.yang29@zte.com.cn>
Subject: [PATCH linux-next] ACPI: sysfs: use sysfs_emit() to instead of scnprintf()
Date: Wed, 9 Nov 2022 21:25:25 +0800 (CST)	[thread overview]
Message-ID: <202211092125250606392@zte.com.cn> (raw)

From: Xu Panda <xu.panda@zte.com.cn>

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>
---
 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 2d81c742e4d2..e6fe1c02a138 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 = {
-- 
2.15.2

             reply	other threads:[~2022-11-09 13:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09 13:25 yang.yang29 [this message]
2022-11-10 19:26 ` [PATCH linux-next] ACPI: sysfs: use sysfs_emit() to instead of scnprintf() Rafael J. Wysocki
  -- strict thread matches above, loose matches on Subject: below --
2022-11-17  1:34 guo.ziliang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202211092125250606392@zte.com.cn \
    --to=yang.yang29@zte.com.cn \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=xu.panda@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox