diff options
author | Christoph Jaeger <christophjaeger@linux.com> | 2014-06-13 15:49:58 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-06-17 08:01:56 -0400 |
commit | 3d915894f8317ac3e55b47da829aa65eb5f9ae97 (patch) | |
tree | f8e523b5f549d1a3779c01b51c2900f057e52dd7 | |
parent | 7171511eaec5bf23fb06078f59784a3a0626b38f (diff) |
ACPI: use kstrto*() instead of simple_strto*()
simple_strto*() are obsolete; use kstrto*() instead. Add proper error
checking.
Signed-off-by: Christoph Jaeger <christophjaeger@linux.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/acpi/battery.c | 5 | ||||
-rw-r--r-- | drivers/acpi/osl.c | 3 | ||||
-rw-r--r-- | drivers/acpi/tables.c | 3 |
3 files changed, 8 insertions, 3 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index e48fc98e71c4..5963e6f0a1ed 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -930,7 +930,10 @@ static ssize_t acpi_battery_write_alarm(struct file *file, | |||
930 | goto end; | 930 | goto end; |
931 | } | 931 | } |
932 | alarm_string[count] = '\0'; | 932 | alarm_string[count] = '\0'; |
933 | battery->alarm = simple_strtol(alarm_string, NULL, 0); | 933 | if (kstrtoint(alarm_string, 0, &battery->alarm)) { |
934 | result = -EINVAL; | ||
935 | goto end; | ||
936 | } | ||
934 | result = acpi_battery_set_alarm(battery); | 937 | result = acpi_battery_set_alarm(battery); |
935 | end: | 938 | end: |
936 | if (!result) | 939 | if (!result) |
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 3f2bdc812d23..bad25b070fe0 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -235,7 +235,8 @@ void acpi_os_vprintf(const char *fmt, va_list args) | |||
235 | static unsigned long acpi_rsdp; | 235 | static unsigned long acpi_rsdp; |
236 | static int __init setup_acpi_rsdp(char *arg) | 236 | static int __init setup_acpi_rsdp(char *arg) |
237 | { | 237 | { |
238 | acpi_rsdp = simple_strtoul(arg, NULL, 16); | 238 | if (kstrtoul(arg, 16, &acpi_rsdp)) |
239 | return -EINVAL; | ||
239 | return 0; | 240 | return 0; |
240 | } | 241 | } |
241 | early_param("acpi_rsdp", setup_acpi_rsdp); | 242 | early_param("acpi_rsdp", setup_acpi_rsdp); |
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index 05550ba44d32..6d5a6cda0734 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c | |||
@@ -360,7 +360,8 @@ static int __init acpi_parse_apic_instance(char *str) | |||
360 | if (!str) | 360 | if (!str) |
361 | return -EINVAL; | 361 | return -EINVAL; |
362 | 362 | ||
363 | acpi_apic_instance = simple_strtoul(str, NULL, 0); | 363 | if (kstrtoint(str, 0, &acpi_apic_instance)) |
364 | return -EINVAL; | ||
364 | 365 | ||
365 | pr_notice("Shall use APIC/MADT table %d\n", acpi_apic_instance); | 366 | pr_notice("Shall use APIC/MADT table %d\n", acpi_apic_instance); |
366 | 367 | ||