diff options
author | Hanjun Guo <hanjun.guo@linaro.org> | 2015-02-05 04:33:14 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-02-05 19:34:47 -0500 |
commit | 2fad93083e288a7d24bf7284c87f0d80a5a2c599 (patch) | |
tree | bf244bbd5cf4033bf07b5cce08562f1b4d779bd1 /arch/x86/kernel | |
parent | e36f014edff70fc02b3d3d79cead1d58f289332e (diff) |
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 <tony.luck@intel.com>
CC: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/acpi/boot.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index b9e30daa0881..14d3652ece8d 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
@@ -843,13 +843,7 @@ int acpi_ioapic_registered(acpi_handle handle, u32 gsi_base) | |||
843 | 843 | ||
844 | static int __init acpi_parse_sbf(struct acpi_table_header *table) | 844 | static int __init acpi_parse_sbf(struct acpi_table_header *table) |
845 | { | 845 | { |
846 | struct acpi_table_boot *sb; | 846 | struct acpi_table_boot *sb = (struct acpi_table_boot *)table; |
847 | |||
848 | sb = (struct acpi_table_boot *)table; | ||
849 | if (!sb) { | ||
850 | printk(KERN_WARNING PREFIX "Unable to map SBF\n"); | ||
851 | return -ENODEV; | ||
852 | } | ||
853 | 847 | ||
854 | sbf_port = sb->cmos_index; /* Save CMOS port */ | 848 | sbf_port = sb->cmos_index; /* Save CMOS port */ |
855 | 849 | ||
@@ -863,13 +857,7 @@ static struct resource *hpet_res __initdata; | |||
863 | 857 | ||
864 | static int __init acpi_parse_hpet(struct acpi_table_header *table) | 858 | static int __init acpi_parse_hpet(struct acpi_table_header *table) |
865 | { | 859 | { |
866 | struct acpi_table_hpet *hpet_tbl; | 860 | struct acpi_table_hpet *hpet_tbl = (struct acpi_table_hpet *)table; |
867 | |||
868 | hpet_tbl = (struct acpi_table_hpet *)table; | ||
869 | if (!hpet_tbl) { | ||
870 | printk(KERN_WARNING PREFIX "Unable to map HPET\n"); | ||
871 | return -ENODEV; | ||
872 | } | ||
873 | 861 | ||
874 | if (hpet_tbl->address.space_id != ACPI_SPACE_MEM) { | 862 | if (hpet_tbl->address.space_id != ACPI_SPACE_MEM) { |
875 | printk(KERN_WARNING PREFIX "HPET timers must be located in " | 863 | printk(KERN_WARNING PREFIX "HPET timers must be located in " |