summaryrefslogtreecommitdiff
path: root/drivers/acpi/battery.c
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2024-06-09 10:27:15 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-06-13 22:26:14 +0300
commitaa532663072c445ba92cb9438ed80533c29bbacb (patch)
tree2c2d2cb2d96ad7e7829ab112a5ddf69768275a1e /drivers/acpi/battery.c
parent3483053d2c1286658a7ce7d7311244882770c99a (diff)
downloadlinux-aa532663072c445ba92cb9438ed80533c29bbacb.tar.xz
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>
Diffstat (limited to 'drivers/acpi/battery.c')
-rw-r--r--drivers/acpi/battery.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 984236b95dff..5f47bd58aff3 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -661,7 +661,7 @@ static ssize_t acpi_battery_alarm_show(struct device *dev,
{
struct acpi_battery *battery = to_acpi_battery(dev_get_drvdata(dev));
- return sprintf(buf, "%d\n", battery->alarm * 1000);
+ return sysfs_emit(buf, "%d\n", battery->alarm * 1000);
}
static ssize_t acpi_battery_alarm_store(struct device *dev,