ACPI: use kstrto*() instead of simple_strto*()
PATCH 1/1 ACPI: use kstrto*() instead of simple_strto*()
simple_strto*() are obsolete; use kstrto*() instead. Add proper error checking.
Signed-off-by Christoph Jaeger <[email protected]>
--- drivers/acpi/battery.c | 5 ++++- drivers/acpi/osl.c | 3 ++- drivers/acpi/tables.c | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-)
drivers/acpi/battery.c +4 -1
@@ -930,7 +930,10 @@ static ssize_t acpi_battery_write_alarm(struct file *file, goto end; } alarm_string[count] ='\0' ; - battery->alarm =simple_strtol (alarm_string,NULL ,0 ); +if (kstrtoint (alarm_string,0 , &battery->alarm)) { + result = -EINVAL ; + goto end; + } result =acpi_battery_set_alarm (battery); end:if (!result)
drivers/acpi/osl.c +2 -1
@@ -235,7 +235,8 @@ void acpi_os_vprintf(const char *fmt, va_list args)static unsigned long acpi_rsdp;static int __init setup_acpi_rsdp (char *arg) { - acpi_rsdp =simple_strtoul (arg,NULL ,16 ); +if (kstrtoul (arg,16 , &acpi_rsdp)) +return -EINVAL ;return 0 ; }early_param ("acpi_rsdp" , setup_acpi_rsdp);
drivers/acpi/tables.c +2 -1
@@ -360,7 +360,8 @@ static int __init acpi_parse_apic_instance(char *str)if (!str)return -EINVAL ; - acpi_apic_instance =simple_strtoul (str,NULL ,0 ); +if (kstrtoint (str,0 , &acpi_apic_instance)) +return -EINVAL ;pr_notice ("Shall use APIC/MADT table %d\n" , acpi_apic_instance);
Signature · 1 line
1.9.3
Quoted 4 lines · Christoph Jaeger
simple_strto*() are obsolete; use kstrto*() instead. Add proper error checking.
Signed-off-by Christoph Jaeger <[email protected]>
Acked-by David Rientjes <[email protected]>
Rafael J. Wysocki
AppliedQuoted 8 lines · David Rientjes
Quoted 4 lines · Christoph Jaeger
simple_strto*() are obsolete; use kstrto*() instead. Add proper error checking.
Signed-off-by Christoph Jaeger <[email protected]>Acked-by David Rientjes <[email protected]>
Applied, thanks!
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.