Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit aa53266

Browse files
t-8chrafaeljw
authored andcommitted
ACPI: battery: use sysfs_emit over sprintf
sysfs_emit validates assumptions made by sysfs and is the correct mechanism to format data for sysfs. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 3483053 commit aa53266

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/acpi/battery.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ static ssize_t acpi_battery_alarm_show(struct device *dev,
661661
{
662662
struct acpi_battery *battery = to_acpi_battery(dev_get_drvdata(dev));
663663

664-
return sprintf(buf, "%d\n", battery->alarm * 1000);
664+
return sysfs_emit(buf, "%d\n", battery->alarm * 1000);
665665
}
666666

667667
static ssize_t acpi_battery_alarm_store(struct device *dev,

0 commit comments

Comments
 (0)