* [PATCH] ACPI: PAD: use sysfs_emit() to instead of scnprintf()
@ 2022-11-29 11:31 ye.xingchen
2022-11-29 17:54 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: ye.xingchen @ 2022-11-29 11:31 UTC (permalink / raw)
To: rafael; +Cc: lenb, linux-acpi, linux-kernel
From: ye xingchen <ye.xingchen@zte.com.cn>
Replace the open-code with sysfs_emit() to simplify the code.
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
drivers/acpi/acpi_pad.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
index edbb28faee2a..02f1a1b1143c 100644
--- a/drivers/acpi/acpi_pad.c
+++ b/drivers/acpi/acpi_pad.c
@@ -287,7 +287,7 @@ static ssize_t rrtime_store(struct device *dev,
static ssize_t rrtime_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- return scnprintf(buf, PAGE_SIZE, "%d\n", round_robin_time);
+ return sysfs_emit(buf, "%d\n", round_robin_time);
}
static DEVICE_ATTR_RW(rrtime);
@@ -309,7 +309,7 @@ static ssize_t idlepct_store(struct device *dev,
static ssize_t idlepct_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- return scnprintf(buf, PAGE_SIZE, "%d\n", idle_pct);
+ return sysfs_emit(buf, "%d\n", idle_pct);
}
static DEVICE_ATTR_RW(idlepct);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ACPI: PAD: use sysfs_emit() to instead of scnprintf()
2022-11-29 11:31 [PATCH] ACPI: PAD: use sysfs_emit() to instead of scnprintf() ye.xingchen
@ 2022-11-29 17:54 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2022-11-29 17:54 UTC (permalink / raw)
To: ye.xingchen; +Cc: rafael, lenb, linux-acpi, linux-kernel
On Tue, Nov 29, 2022 at 12:32 PM <ye.xingchen@zte.com.cn> wrote:
>
> From: ye xingchen <ye.xingchen@zte.com.cn>
>
> Replace the open-code with sysfs_emit() to simplify the code.
>
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Can you please send one combo patch for this for all of the affected
code in drivers/acpi/?
> ---
> drivers/acpi/acpi_pad.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
> index edbb28faee2a..02f1a1b1143c 100644
> --- a/drivers/acpi/acpi_pad.c
> +++ b/drivers/acpi/acpi_pad.c
> @@ -287,7 +287,7 @@ static ssize_t rrtime_store(struct device *dev,
> static ssize_t rrtime_show(struct device *dev,
> struct device_attribute *attr, char *buf)
> {
> - return scnprintf(buf, PAGE_SIZE, "%d\n", round_robin_time);
> + return sysfs_emit(buf, "%d\n", round_robin_time);
> }
> static DEVICE_ATTR_RW(rrtime);
>
> @@ -309,7 +309,7 @@ static ssize_t idlepct_store(struct device *dev,
> static ssize_t idlepct_show(struct device *dev,
> struct device_attribute *attr, char *buf)
> {
> - return scnprintf(buf, PAGE_SIZE, "%d\n", idle_pct);
> + return sysfs_emit(buf, "%d\n", idle_pct);
> }
> static DEVICE_ATTR_RW(idlepct);
>
> --
> 2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-11-29 17:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-29 11:31 [PATCH] ACPI: PAD: use sysfs_emit() to instead of scnprintf() ye.xingchen
2022-11-29 17:54 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox