From: Hanjun Guo Date: Tue, 21 Jul 2020 09:59:04 +0000 (+0800) Subject: ACPI: tables: Remove the duplicated checks for acpi_parse_entries_array() X-Git-Tag: v5.10.7~1984^2^3~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=24194a7e03f46f08579e3094417e448a92aff2b4;p=platform%2Fkernel%2Flinux-rpi.git ACPI: tables: Remove the duplicated checks for acpi_parse_entries_array() acpi_disabled, pointer id and table_header are checked in acpi_table_parse_entries_array(), and acpi_parse_entries_array() is only called by acpi_table_parse_entries_array(), so those checks in acpi_parse_entries_array() are duplicate. Remove those duplicated checks and move the table_size check to acpi_table_parse_entries_array() as well. Signed-off-by: Hanjun Guo Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index ada36bc..e48690a 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c @@ -292,20 +292,6 @@ static int __init acpi_parse_entries_array(char *id, unsigned long table_size, int errs = 0; int i; - if (acpi_disabled) - return -ENODEV; - - if (!id) - return -EINVAL; - - if (!table_size) - return -EINVAL; - - if (!table_header) { - pr_warn("%4.4s not present\n", id); - return -ENODEV; - } - table_end = (unsigned long)table_header + table_header->length; /* Parse all entries looking for a match. */ @@ -371,6 +357,9 @@ int __init acpi_table_parse_entries_array(char *id, if (!id) return -EINVAL; + if (!table_size) + return -EINVAL; + if (!strncmp(id, ACPI_SIG_MADT, 4)) instance = acpi_apic_instance;