Skip to content

Commit

Permalink
ACPI: tables: Remove the duplicated checks for acpi_parse_entries_arr…
Browse files Browse the repository at this point in the history
…ay()

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 <guohanjun@huawei.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Hanjun Guo authored and Rafael J. Wysocki committed Jul 27, 2020
1 parent 2229a12 commit 24194a7
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions drivers/acpi/tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 24194a7

Please sign in to comment.