diff options
author | Bob Moore <robert.moore@intel.com> | 2016-09-07 14:14:30 +0800 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-09-10 02:37:59 +0200 |
commit | 5ebd2eaaefc0d4fe37ab72e716e1b8065ed4206c (patch) | |
tree | 36563f7c5e47e58b2d0fe5624f135a19dfbd3c33 /drivers/acpi/acpica/evgpeinit.c | |
parent | 60361b75848c8614233e3374ef5a0056527f0385 (diff) | |
download | linux-5ebd2eaaefc0d4fe37ab72e716e1b8065ed4206c.tar.gz linux-5ebd2eaaefc0d4fe37ab72e716e1b8065ed4206c.tar.bz2 linux-5ebd2eaaefc0d4fe37ab72e716e1b8065ed4206c.zip |
ACPICA: Cleanup for all string-to-integer conversions
ACPICA commit e2e72a351201fd58e4694418859ae2c247dafca0
Consolidate multiple versions of strtoul64 to one common version.
limit possible bases to either 10 or 16.
Handles both implicit and explicit conversions.
Added a 2-character ascii-to-hex function for GPEs and buffers.
Adds a new file, utstrtoul64.c
Link: https://github.com/acpica/acpica/commit/e2e72a35
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/evgpeinit.c')
-rw-r--r-- | drivers/acpi/acpica/evgpeinit.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/acpi/acpica/evgpeinit.c b/drivers/acpi/acpica/evgpeinit.c index 7dc75474c897..16ce4835e7d0 100644 --- a/drivers/acpi/acpica/evgpeinit.c +++ b/drivers/acpi/acpica/evgpeinit.c @@ -323,7 +323,9 @@ acpi_ev_match_gpe_method(acpi_handle obj_handle, struct acpi_gpe_walk_info *walk_info = ACPI_CAST_PTR(struct acpi_gpe_walk_info, context); struct acpi_gpe_event_info *gpe_event_info; + acpi_status status; u32 gpe_number; + u8 temp_gpe_number; char name[ACPI_NAME_SIZE + 1]; u8 type; @@ -377,8 +379,8 @@ acpi_ev_match_gpe_method(acpi_handle obj_handle, /* 4) The last two characters of the name are the hex GPE Number */ - gpe_number = strtoul(&name[2], NULL, 16); - if (gpe_number == ACPI_UINT32_MAX) { + status = acpi_ut_ascii_to_hex_byte(&name[2], &temp_gpe_number); + if (ACPI_FAILURE(status)) { /* Conversion failed; invalid method, just ignore it */ @@ -390,6 +392,7 @@ acpi_ev_match_gpe_method(acpi_handle obj_handle, /* Ensure that we have a valid GPE number for this GPE block */ + gpe_number = (u32)temp_gpe_number; gpe_event_info = acpi_ev_low_get_gpe_info(gpe_number, walk_info->gpe_block); if (!gpe_event_info) { |