* [PATCH linux-next] ACPI: sysfs: use sysfs_emit() to instead of scnprintf()
@ 2022-11-09 13:25 yang.yang29
2022-11-10 19:26 ` Rafael J. Wysocki
0 siblings, 1 reply; 3+ messages in thread
From: yang.yang29 @ 2022-11-09 13:25 UTC (permalink / raw)
To: rafael; +Cc: lenb, linux-acpi, linux-kernel, xu.panda, yang.yang29
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH linux-next] ACPI: sysfs: use sysfs_emit() to instead of scnprintf()
2022-11-09 13:25 [PATCH linux-next] ACPI: sysfs: use sysfs_emit() to instead of scnprintf() yang.yang29
@ 2022-11-10 19:26 ` Rafael J. Wysocki
0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2022-11-10 19:26 UTC (permalink / raw)
To: yang.yang29; +Cc: rafael, lenb, linux-acpi, linux-kernel, xu.panda
On Wed, Nov 9, 2022 at 2:25 PM <yang.yang29@zte.com.cn> wrote:
>
> 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 = {
> --
Applied as 6.2 material, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH linux-next] ACPI: sysfs: use sysfs_emit() to instead of scnprintf()
@ 2022-11-17 1:34 guo.ziliang
0 siblings, 0 replies; 3+ messages in thread
From: guo.ziliang @ 2022-11-17 1:34 UTC (permalink / raw)
To: rafael; +Cc: lenb, linux-acpi, linux-kernel
From: guo ziliang <guo.ziliang@zte.com.cn>
Replace the open-code with sysfs_emit() to simplify the code.
Signed-off-by: guo ziliang <guo.ziliang@zte.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
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-11-17 1:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09 13:25 [PATCH linux-next] ACPI: sysfs: use sysfs_emit() to instead of scnprintf() yang.yang29
2022-11-10 19:26 ` Rafael J. Wysocki
2022-11-17 1:34 guo.ziliang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).