Linux ACPI
 help / color / mirror / Atom feed
* [PATCH] ACPI: fan_attr: Replace sprintf with sysfs_emit
@ 2025-07-04  0:40 Eslam Khafagy
  2025-07-07 16:29 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Eslam Khafagy @ 2025-07-04  0:40 UTC (permalink / raw)
  To: rafael; +Cc: Eslam Khafagy, lenb, linux-acpi, skhan

Replace sprintf with sysfs_emit in function show_fine_grain_control in
according to Documentation/filesystems/sysfs.rst.

This patch builds on the fix proposed in patch:
Message-ID 20250621055200.166361-1-abdelrahmanfekry375@gmail.com

Signed-off-by: Eslam Khafagy <eslam.medhat1993@gmail.com>
---
 drivers/acpi/fan_attr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/fan_attr.c b/drivers/acpi/fan_attr.c
index 22d29ac2447c..f4e7f2351616 100644
--- a/drivers/acpi/fan_attr.c
+++ b/drivers/acpi/fan_attr.c
@@ -67,7 +67,7 @@ static ssize_t show_fine_grain_control(struct device *dev, struct device_attribu
 	struct acpi_device *acpi_dev = container_of(dev, struct acpi_device, dev);
 	struct acpi_fan *fan = acpi_driver_data(acpi_dev);
 
-	return sprintf(buf, "%d\n", fan->fif.fine_grain_ctrl);
+	return sysfs_emit(buf, "%d\n", fan->fif.fine_grain_ctrl);
 }
 
 int acpi_fan_create_attributes(struct acpi_device *device)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ACPI: fan_attr: Replace sprintf with sysfs_emit
  2025-07-04  0:40 [PATCH] ACPI: fan_attr: Replace sprintf with sysfs_emit Eslam Khafagy
@ 2025-07-07 16:29 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2025-07-07 16:29 UTC (permalink / raw)
  To: Eslam Khafagy; +Cc: rafael, lenb, linux-acpi, skhan

On Fri, Jul 4, 2025 at 2:40 AM Eslam Khafagy <eslam.medhat1993@gmail.com> wrote:
>
> Replace sprintf with sysfs_emit in function show_fine_grain_control in
> according to Documentation/filesystems/sysfs.rst.
>
> This patch builds on the fix proposed in patch:
> Message-ID 20250621055200.166361-1-abdelrahmanfekry375@gmail.com
>
> Signed-off-by: Eslam Khafagy <eslam.medhat1993@gmail.com>
> ---
>  drivers/acpi/fan_attr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/fan_attr.c b/drivers/acpi/fan_attr.c
> index 22d29ac2447c..f4e7f2351616 100644
> --- a/drivers/acpi/fan_attr.c
> +++ b/drivers/acpi/fan_attr.c
> @@ -67,7 +67,7 @@ static ssize_t show_fine_grain_control(struct device *dev, struct device_attribu
>         struct acpi_device *acpi_dev = container_of(dev, struct acpi_device, dev);
>         struct acpi_fan *fan = acpi_driver_data(acpi_dev);
>
> -       return sprintf(buf, "%d\n", fan->fif.fine_grain_ctrl);
> +       return sysfs_emit(buf, "%d\n", fan->fif.fine_grain_ctrl);
>  }
>
>  int acpi_fan_create_attributes(struct acpi_device *device)
> --

Applied as 6.17 material, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-07 16:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-04  0:40 [PATCH] ACPI: fan_attr: Replace sprintf with sysfs_emit Eslam Khafagy
2025-07-07 16:29 ` 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