From 69fd92ecb217a4e6c33eccd346f8e81076969ebe Mon Sep 17 00:00:00 2001 From: Feng Tang Date: Fri, 10 Jul 2009 16:37:29 +0800 Subject: SFI: code clean according to Ingo's comments for v2 changes are: * rename uniq_ioapic_id() to unique_ioapic_id() * fix some comment format problem and typo * add __read_mostly for xsdt_va Signed-off-by: Feng Tang Signed-off-by: Len Brown --- arch/x86/include/asm/io_apic.h | 2 +- arch/x86/kernel/acpi/boot.c | 2 +- arch/x86/kernel/apic/io_apic.c | 3 ++- arch/x86/kernel/sfi.c | 9 ++++----- drivers/sfi/Kconfig | 3 +-- drivers/sfi/sfi_acpi.c | 2 +- drivers/sfi/sfi_core.c | 7 ++++--- include/linux/sfi.h | 2 +- include/linux/sfi_acpi.h | 6 +++--- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h index 1a097b9df910..2493bde4e822 100644 --- a/arch/x86/include/asm/io_apic.h +++ b/arch/x86/include/asm/io_apic.h @@ -150,7 +150,7 @@ extern int timer_through_8259; #define io_apic_assign_pci_irqs \ (mp_irq_entries && !skip_ioapic_setup && io_apic_irqs) -extern u8 uniq_ioapic_id(u8 id); +extern u8 unique_ioapic_id(u8 id); extern int io_apic_get_unique_id(int ioapic, int apic_id); extern int io_apic_get_version(int ioapic); extern int io_apic_get_redir_entries(int ioapic); diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index a7f9e89741c2..716724515e6e 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -892,7 +892,7 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base) mp_ioapics[idx].apicaddr = address; set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address); - mp_ioapics[idx].apicid = uniq_ioapic_id(id); + mp_ioapics[idx].apicid = unique_ioapic_id(id); mp_ioapics[idx].apicver = io_apic_get_version(idx); /* diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 5884e605b3c0..55b85af6e941 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -3944,7 +3944,7 @@ int io_apic_set_pci_routing(struct device *dev, int irq, return __io_apic_set_pci_routing(dev, irq, irq_attr); } -u8 __init uniq_ioapic_id(u8 id) +u8 __init unique_ioapic_id(u8 id) { #ifdef CONFIG_X86_32 if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && @@ -3955,6 +3955,7 @@ u8 __init uniq_ioapic_id(u8 id) #else int i; DECLARE_BITMAP(used, 256); + bitmap_zero(used, 256); for (i = 0; i < nr_ioapics; i++) { struct mpc_ioapic *ia = &mp_ioapics[i]; diff --git a/arch/x86/kernel/sfi.c b/arch/x86/kernel/sfi.c index b23e4892d23e..bf42a0e1e6f0 100644 --- a/arch/x86/kernel/sfi.c +++ b/arch/x86/kernel/sfi.c @@ -84,16 +84,15 @@ int __init sfi_init_memory_map(void) if (sfi_disabled) return -1; - /* first search the syst table */ + /* first search the SYST table */ syst = sfi_early_find_syst(); if (!syst) return -1; - tbl_cnt = (syst->header.length - sizeof(struct sfi_table_header)) / - sizeof(u64); + tbl_cnt = SFI_GET_NUM_ENTRIES(syst, u64); pentry = syst->pentry; - /* walk through the syst to search the mmap table */ + /* walk through the SYST to search the mmap table */ mmapt = NULL; for (i = 0; i < tbl_cnt; i++) { if (!strncmp(SFI_SIG_MMAP, (char *)(unsigned long)*pentry, 4)) { @@ -217,7 +216,7 @@ void __init mp_sfi_register_ioapic(u8 id, u32 paddr) mp_ioapics[idx].apicaddr = paddr; set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, paddr); - tmpid = uniq_ioapic_id(id); + tmpid = unique_ioapic_id(id); if (tmpid == -1) return; diff --git a/drivers/sfi/Kconfig b/drivers/sfi/Kconfig index b217f32516bc..620921c62098 100644 --- a/drivers/sfi/Kconfig +++ b/drivers/sfi/Kconfig @@ -5,10 +5,9 @@ menuconfig SFI bool "SFI (Simple Firmware Interface) Support" depends on X86 - default n ---help--- The Simple Firmware Interface (SFI) provides a lightweight method - for platform firmware to pass information to the Operating System + for platform firmware to pass information to the operating system via static tables in memory. For more information, see http://simplefirmware.org diff --git a/drivers/sfi/sfi_acpi.c b/drivers/sfi/sfi_acpi.c index 0cc2332297ed..d793d7682807 100644 --- a/drivers/sfi/sfi_acpi.c +++ b/drivers/sfi/sfi_acpi.c @@ -54,7 +54,7 @@ * and is expected to be present many SFI-only systems. */ -static struct acpi_table_xsdt *xsdt_va; +static struct acpi_table_xsdt *xsdt_va __read_mostly; #define XSDT_GET_NUM_ENTRIES(ptable, entry_type) \ ((ptable->header.length - sizeof(struct acpi_table_header)) / \ diff --git a/drivers/sfi/sfi_core.c b/drivers/sfi/sfi_core.c index f411a02a697c..d8a031440498 100644 --- a/drivers/sfi/sfi_core.c +++ b/drivers/sfi/sfi_core.c @@ -226,18 +226,19 @@ void sfi_put_table(struct sfi_table_header *table) int sfi_table_parse(char *signature, char *oem_id, char *oem_table_id, unsigned int flags, sfi_table_handler handler) { - int ret = 0; struct sfi_table_header *table = NULL; + int ret = -EINVAL; if (sfi_disabled || !handler || !signature) - return -EINVAL; + goto exit; table = sfi_get_table(signature, oem_id, oem_table_id, flags); if (!table) - return -EINVAL; + goto exit; ret = handler(table); sfi_put_table(table); +exit: return ret; } EXPORT_SYMBOL_GPL(sfi_table_parse); diff --git a/include/linux/sfi.h b/include/linux/sfi.h index f00f4da40a74..adb2eff1fa57 100644 --- a/include/linux/sfi.h +++ b/include/linux/sfi.h @@ -153,7 +153,7 @@ struct sfi_gpe_table_entry { typedef int (*sfi_table_handler) (struct sfi_table_header *table); -#ifdef CONFIG_SFI +#ifdef CONFIG_SFI extern int __init sfi_init_memory_map(void); extern void __init sfi_init(void); extern int __init sfi_platform_init(void); diff --git a/include/linux/sfi_acpi.h b/include/linux/sfi_acpi.h index d19a00a55c00..a633fb9fbe27 100644 --- a/include/linux/sfi_acpi.h +++ b/include/linux/sfi_acpi.h @@ -40,7 +40,7 @@ #ifndef _LINUX_SFI_ACPI_H #define _LINUX_SFI_ACPI_H -#ifdef CONFIG_SFI +#ifdef CONFIG_SFI #include /* struct acpi_table_header */ int sfi_acpi_table_parse(char *signature, char *oem_id, char* oem_table_id, @@ -55,6 +55,6 @@ static inline int sfi_acpi_table_parse(char *signature, char *oem_id, return -1; } -#endif /* CONFIG_SFI */ +#endif /* CONFIG_SFI */ -#endif /*_LINUX_SFI_ACPI_H*/ +#endif /*_LINUX_SFI_ACPI_H*/ -- cgit v1.2.3