ACPI / table: remove duplicate NULL check for the handler of acpi_table_parse()

In acpi_table_parse(), pointer of the table to pass to handler() is
checked before handler() called, so remove all the duplicate NULL
check in the handler function.

CC: Tony Luck <[email protected]>
CC: Thomas Gleixner <[email protected]>
Signed-off-by: Hanjun Guo <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
Hanjun Guo 2015-02-05 17:33:14 +08:00 • committed by Rafael J. Wysocki
commit 2fad93083e
3 changed files with 4 additions and 30 deletions

View file

@ -177,12 +177,7 @@ static int __init slit_valid(struct acpi_table_slit *slit)
static int __init acpi_parse_slit(struct acpi_table_header *table)
{
struct acpi_table_slit *slit;
if (!table)
return -EINVAL;
slit = (struct acpi_table_slit *)table;
struct acpi_table_slit *slit = (struct acpi_table_slit *)table;
if (!slit_valid(slit)) {
printk(KERN_INFO "ACPI: SLIT table looks invalid. Not used.\n");
@ -260,11 +255,8 @@ acpi_parse_memory_affinity(struct acpi_subtable_header * header,
static int __init acpi_parse_srat(struct acpi_table_header *table)
{
struct acpi_table_srat *srat;
if (!table)
return -EINVAL;
struct acpi_table_srat *srat = (struct acpi_table_srat *)table;
srat = (struct acpi_table_srat *)table;
acpi_srat_revision = srat->header.revision;
/* Real work done in acpi_table_parse_srat below. */