ACPI / battery: Fix incorrect sscanf() string in acpi_battery_init_alarm()
authorLuis G.F <luisgf@luisgf.es>
Tue, 21 Jan 2014 14:40:43 +0000 (15:40 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 5 Feb 2014 00:07:54 +0000 (01:07 +0100)
Fix incorrect sscanf() string in acpi_battery_init_alarm().
Change from %ld to %lu, because 'x' is unsigned long.

Signed-off-by: Luis G.F <luisgf@luisgf.es>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/battery.c

index 470e754..018a428 100644 (file)
@@ -549,7 +549,7 @@ static ssize_t acpi_battery_alarm_store(struct device *dev,
 {
        unsigned long x;
        struct acpi_battery *battery = to_acpi_battery(dev_get_drvdata(dev));
-       if (sscanf(buf, "%ld\n", &x) == 1)
+       if (sscanf(buf, "%lu\n", &x) == 1)
                battery->alarm = x/1000;
        if (acpi_battery_present(battery))
                acpi_battery_set_alarm(battery);