Skip to content

Commit 24194a7

Browse files
guohanjunrafaeljw
authored andcommitted
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 <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 2229a12 commit 24194a7

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

drivers/acpi/tables.c

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -292,20 +292,6 @@ static int __init acpi_parse_entries_array(char *id, unsigned long table_size,
292292
int errs = 0;
293293
int i;
294294

295-
if (acpi_disabled)
296-
return -ENODEV;
297-
298-
if (!id)
299-
return -EINVAL;
300-
301-
if (!table_size)
302-
return -EINVAL;
303-
304-
if (!table_header) {
305-
pr_warn("%4.4s not present\n", id);
306-
return -ENODEV;
307-
}
308-
309295
table_end = (unsigned long)table_header + table_header->length;
310296

311297
/* Parse all entries looking for a match. */
@@ -371,6 +357,9 @@ int __init acpi_table_parse_entries_array(char *id,
371357
if (!id)
372358
return -EINVAL;
373359

360+
if (!table_size)
361+
return -EINVAL;
362+
374363
if (!strncmp(id, ACPI_SIG_MADT, 4))
375364
instance = acpi_apic_instance;
376365

0 commit comments

Comments
 (0)