arch/x86: Fix issues with braces detected by checkpatch

Fix the following errors and warnings detected by checkpatch.pl:

ERROR: open brace '{' following function declarations go on the next line
ERROR: that open brace { should be on the previous line
ERROR: else should follow close brace '}'
WARNING: braces {} are not necessary for any arm of this statement
WARNING: braces {} are not necessary for single statement blocks

TEST=Build and run on Galileo Gen2

Change-Id: I13d1967757e106c8300a15baed25d920c52a1a95
Signed-off-by: Lee Leahy <Leroy.P.Leahy@intel.com>
Reviewed-on: https://review.coreboot.org/18861
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Lee Leahy
2017-03-16 11:24:09 -07:00
parent d94cff6ab2
commit 9c7c6f7213
12 changed files with 66 additions and 102 deletions

View File

@ -287,9 +287,8 @@ static void acpi_create_tcpa(acpi_tcpa_t *tcpa)
memset((void *)tcpa, 0, sizeof(acpi_tcpa_t)); memset((void *)tcpa, 0, sizeof(acpi_tcpa_t));
lasa = get_tcpa_log(&tcpa_log_len); lasa = get_tcpa_log(&tcpa_log_len);
if (!lasa) { if (!lasa)
return; return;
}
/* Fill out header fields. */ /* Fill out header fields. */
memcpy(header->signature, "TCPA", 4); memcpy(header->signature, "TCPA", 4);
@ -354,9 +353,8 @@ void acpi_create_ssdt_generator(acpi_header_t *ssdt, const char *oem_table_id)
{ {
struct device *dev; struct device *dev;
for (dev = all_devices; dev; dev = dev->next) for (dev = all_devices; dev; dev = dev->next)
if (dev->ops && dev->ops->acpi_fill_ssdt_generator) { if (dev->ops && dev->ops->acpi_fill_ssdt_generator)
dev->ops->acpi_fill_ssdt_generator(dev); dev->ops->acpi_fill_ssdt_generator(dev);
}
current = (unsigned long) acpigen_get_current(); current = (unsigned long) acpigen_get_current();
} }
@ -840,11 +838,10 @@ void acpi_create_fadt(acpi_fadt_t *fadt,acpi_facs_t *facs, void *dsdt)
fadt->x_dsdt_l = (unsigned long)dsdt; fadt->x_dsdt_l = (unsigned long)dsdt;
fadt->x_dsdt_h = 0; fadt->x_dsdt_h = 0;
if (IS_ENABLED(CONFIG_SYSTEM_TYPE_LAPTOP)) { if (IS_ENABLED(CONFIG_SYSTEM_TYPE_LAPTOP))
fadt->preferred_pm_profile = PM_MOBILE; fadt->preferred_pm_profile = PM_MOBILE;
} else { else
fadt->preferred_pm_profile = PM_DESKTOP; fadt->preferred_pm_profile = PM_DESKTOP;
}
acpi_fill_fadt(fadt); acpi_fill_fadt(fadt);
@ -953,9 +950,8 @@ unsigned long write_acpi_tables(unsigned long start)
acpigen_set_current((char *) current); acpigen_set_current((char *) current);
for (dev = all_devices; dev; dev = dev->next) for (dev = all_devices; dev; dev = dev->next)
if (dev->ops && dev->ops->acpi_inject_dsdt_generator) { if (dev->ops && dev->ops->acpi_inject_dsdt_generator)
dev->ops->acpi_inject_dsdt_generator(dev); dev->ops->acpi_inject_dsdt_generator(dev);
}
current = (unsigned long) acpigen_get_current(); current = (unsigned long) acpigen_get_current();
memcpy((char *)current, memcpy((char *)current,
(char *)dsdt_file + sizeof(acpi_header_t), (char *)dsdt_file + sizeof(acpi_header_t),

View File

@ -204,9 +204,8 @@ void acpigen_write_name_string(const char *name, const char *string)
void acpigen_emit_stream(const char *data, int size) void acpigen_emit_stream(const char *data, int size)
{ {
int i; int i;
for (i = 0; i < size; i++) { for (i = 0; i < size; i++)
acpigen_emit_byte(data[i]); acpigen_emit_byte(data[i]);
}
} }
void acpigen_emit_string(const char *string) void acpigen_emit_string(const char *string)
@ -238,7 +237,8 @@ void acpigen_write_coreboot_hid(enum coreboot_acpi_ids id)
* Check sections 5.3, 18.2.2 and 18.4 of ACPI spec 3.0 for details. * Check sections 5.3, 18.2.2 and 18.4 of ACPI spec 3.0 for details.
*/ */
static void acpigen_emit_simple_namestring(const char *name) { static void acpigen_emit_simple_namestring(const char *name)
{
int i; int i;
char ud[] = "____"; char ud[] = "____";
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
@ -251,13 +251,15 @@ static void acpigen_emit_simple_namestring(const char *name) {
} }
} }
static void acpigen_emit_double_namestring(const char *name, int dotpos) { static void acpigen_emit_double_namestring(const char *name, int dotpos)
{
acpigen_emit_byte(DUAL_NAME_PREFIX); acpigen_emit_byte(DUAL_NAME_PREFIX);
acpigen_emit_simple_namestring(name); acpigen_emit_simple_namestring(name);
acpigen_emit_simple_namestring(&name[dotpos + 1]); acpigen_emit_simple_namestring(&name[dotpos + 1]);
} }
static void acpigen_emit_multi_namestring(const char *name) { static void acpigen_emit_multi_namestring(const char *name)
{
int count = 0; int count = 0;
unsigned char *pathlen; unsigned char *pathlen;
acpigen_emit_byte(MULTI_NAME_PREFIX); acpigen_emit_byte(MULTI_NAME_PREFIX);
@ -279,7 +281,8 @@ static void acpigen_emit_multi_namestring(const char *name) {
} }
void acpigen_emit_namestring(const char *namepath) { void acpigen_emit_namestring(const char *namepath)
{
int dotcount = 0, i; int dotcount = 0, i;
int dotpos = 0; int dotpos = 0;
@ -311,13 +314,12 @@ void acpigen_emit_namestring(const char *namepath) {
i++; i++;
} }
if (dotcount == 0) { if (dotcount == 0)
acpigen_emit_simple_namestring(namepath); acpigen_emit_simple_namestring(namepath);
} else if (dotcount == 1) { else if (dotcount == 1)
acpigen_emit_double_namestring(namepath, dotpos); acpigen_emit_double_namestring(namepath, dotpos);
} else { else
acpigen_emit_multi_namestring(namepath); acpigen_emit_multi_namestring(namepath);
}
} }
void acpigen_write_name(const char *name) void acpigen_write_name(const char *name)

View File

@ -16,7 +16,8 @@
#include <pc80/mc146818rtc.h> #include <pc80/mc146818rtc.h>
#include <halt.h> #include <halt.h>
static const char *get_fallback(const char *stagelist) { static const char *get_fallback(const char *stagelist)
{
while (*stagelist) stagelist++; while (*stagelist) stagelist++;
return ++stagelist; return ++stagelist;
} }

View File

@ -137,9 +137,7 @@ static const char *cpu_vendor_name(int vendor)
name = "<invalid CPU vendor>"; name = "<invalid CPU vendor>";
if ((vendor < (ARRAY_SIZE(x86_vendor_name))) && if ((vendor < (ARRAY_SIZE(x86_vendor_name))) &&
(x86_vendor_name[vendor] != 0)) (x86_vendor_name[vendor] != 0))
{
name = x86_vendor_name[vendor]; name = x86_vendor_name[vendor];
}
return name; return name;
} }
@ -154,19 +152,16 @@ static void identify_cpu(struct device *cpu)
/* Find the id and vendor_name */ /* Find the id and vendor_name */
if (!cpu_have_cpuid()) { if (!cpu_have_cpuid()) {
/* Its a 486 if we can modify the AC flag */ /* Its a 486 if we can modify the AC flag */
if (flag_is_changeable_p(X86_EFLAGS_AC)) { if (flag_is_changeable_p(X86_EFLAGS_AC))
cpu->device = 0x00000400; /* 486 */ cpu->device = 0x00000400; /* 486 */
} else { else
cpu->device = 0x00000300; /* 386 */ cpu->device = 0x00000300; /* 386 */
} if ((cpu->device == 0x00000400) && test_cyrix_52div())
if ((cpu->device == 0x00000400) && test_cyrix_52div()) {
memcpy(vendor_name, "CyrixInstead", 13); memcpy(vendor_name, "CyrixInstead", 13);
/* If we ever care we can enable cpuid here */ /* If we ever care we can enable cpuid here */
}
/* Detect NexGen with old hypercode */ /* Detect NexGen with old hypercode */
else if (deep_magic_nexgen_probe()) { else if (deep_magic_nexgen_probe())
memcpy(vendor_name, "NexGenDriven", 13); memcpy(vendor_name, "NexGenDriven", 13);
}
} }
#endif #endif
if (cpu_have_cpuid()) { if (cpu_have_cpuid()) {
@ -189,13 +184,11 @@ static void identify_cpu(struct device *cpu)
vendor_name[12] = '\0'; vendor_name[12] = '\0';
/* Intel-defined flags: level 0x00000001 */ /* Intel-defined flags: level 0x00000001 */
if (cpuid_level >= 0x00000001) { if (cpuid_level >= 0x00000001)
cpu->device = cpuid_eax(0x00000001); cpu->device = cpuid_eax(0x00000001);
} else
else {
/* Have CPUID level 0 only unheard of */ /* Have CPUID level 0 only unheard of */
cpu->device = 0x00000400; cpu->device = 0x00000400;
}
} }
cpu->vendor = X86_VENDOR_UNKNOWN; cpu->vendor = X86_VENDOR_UNKNOWN;
for (i = 0; i < ARRAY_SIZE(x86_vendors); i++) { for (i = 0; i < ARRAY_SIZE(x86_vendors); i++) {
@ -215,9 +208,7 @@ struct cpu_driver *find_cpu_driver(struct device *cpu)
id->vendor != X86_VENDOR_INVALID; id++) { id->vendor != X86_VENDOR_INVALID; id++) {
if ((cpu->vendor == id->vendor) && if ((cpu->vendor == id->vendor) &&
(cpu->device == id->device)) (cpu->device == id->device))
{
return driver; return driver;
}
if (X86_VENDOR_ANY == id->vendor) if (X86_VENDOR_ANY == id->vendor)
return driver; return driver;
} }
@ -247,9 +238,8 @@ void cpu_initialize(unsigned int index)
printk(BIOS_INFO, "Initializing CPU #%d\n", index); printk(BIOS_INFO, "Initializing CPU #%d\n", index);
cpu = info->cpu; cpu = info->cpu;
if (!cpu) { if (!cpu)
die("CPU: missing CPU device structure"); die("CPU: missing CPU device structure");
}
if (cpu->initialized) if (cpu->initialized)
return; return;

View File

@ -187,8 +187,7 @@ static uint32_t gdb_stub_registers[NUM_REGS];
static unsigned char exception_to_signal[] = static unsigned char exception_to_signal[] = {
{
[0] = GDB_SIGFPE, /* divide by zero */ [0] = GDB_SIGFPE, /* divide by zero */
[1] = GDB_SIGTRAP, /* debug exception */ [1] = GDB_SIGTRAP, /* debug exception */
[2] = GDB_SIGSEGV, /* NMI Interrupt */ [2] = GDB_SIGSEGV, /* NMI Interrupt */
@ -342,8 +341,7 @@ static int get_packet(char *buffer)
if (checksum != xmitcsum) { if (checksum != xmitcsum) {
stub_putc('-'); /* failed checksum */ stub_putc('-'); /* failed checksum */
stub_flush(); stub_flush();
} } else {
else {
stub_putc('+'); /* successful transfer */ stub_putc('+'); /* successful transfer */
stub_flush(); stub_flush();
} }
@ -394,9 +392,8 @@ void x86_exception(struct eregs *info)
gdb_stub_registers[CS] = info->cs; gdb_stub_registers[CS] = info->cs;
gdb_stub_registers[PS] = info->eflags; gdb_stub_registers[PS] = info->eflags;
signo = GDB_UNKNOWN; signo = GDB_UNKNOWN;
if (info->vector < ARRAY_SIZE(exception_to_signal)) { if (info->vector < ARRAY_SIZE(exception_to_signal))
signo = exception_to_signal[info->vector]; signo = exception_to_signal[info->vector];
}
/* reply to the host that an exception has occurred */ /* reply to the host that an exception has occurred */
out_buffer[0] = 'S'; out_buffer[0] = 'S';
@ -410,9 +407,8 @@ void x86_exception(struct eregs *info)
char *ptr; char *ptr;
out_buffer[0] = '\0'; out_buffer[0] = '\0';
out_buffer[1] = '\0'; out_buffer[1] = '\0';
if (!get_packet(in_buffer)) { if (!get_packet(in_buffer))
break; break;
}
switch(in_buffer[0]) { switch(in_buffer[0]) {
case '?': /* last signal */ case '?': /* last signal */
out_buffer[0] = 'S'; out_buffer[0] = 'S';
@ -438,9 +434,8 @@ void x86_exception(struct eregs *info)
(*ptr++ == ',') && (*ptr++ == ',') &&
parse_ulong(&ptr, &length)) { parse_ulong(&ptr, &length)) {
copy_to_hex(out_buffer, (void *)addr, length); copy_to_hex(out_buffer, (void *)addr, length);
} else { } else
memcpy(out_buffer, "E01", 4); memcpy(out_buffer, "E01", 4);
}
break; break;
case 'M': case 'M':
/* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */ /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
@ -451,26 +446,22 @@ void x86_exception(struct eregs *info)
(*(ptr++) == ':')) { (*(ptr++) == ':')) {
copy_from_hex((void *)addr, ptr, length); copy_from_hex((void *)addr, ptr, length);
memcpy(out_buffer, "OK", 3); memcpy(out_buffer, "OK", 3);
} } else
else {
memcpy(out_buffer, "E02", 4); memcpy(out_buffer, "E02", 4);
}
break; break;
case 's': case 's':
case 'c': case 'c':
/* cAA..AA Continue at address AA..AA(optional) */ /* cAA..AA Continue at address AA..AA(optional) */
/* sAA..AA Step one instruction from AA..AA(optional) */ /* sAA..AA Step one instruction from AA..AA(optional) */
ptr = &in_buffer[1]; ptr = &in_buffer[1];
if (parse_ulong(&ptr, &addr)) { if (parse_ulong(&ptr, &addr))
info->eip = addr; info->eip = addr;
}
/* Clear the trace bit */ /* Clear the trace bit */
info->eflags &= ~(1 << 8); info->eflags &= ~(1 << 8);
/* Set the trace bit if we are single stepping */ /* Set the trace bit if we are single stepping */
if (in_buffer[0] == 's') { if (in_buffer[0] == 's')
info->eflags |= (1 << 8); info->eflags |= (1 << 8);
}
return; return;
break; break;
case 'D': case 'D':
@ -513,8 +504,7 @@ void x86_exception(struct eregs *info)
* evident from the looking at the dump */ * evident from the looking at the dump */
code = (u8*)((uintptr_t)code & ~0x7); code = (u8*)((uintptr_t)code & ~0x7);
int i; int i;
for (i = 0; i < MDUMP_SIZE; i++) for (i = 0; i < MDUMP_SIZE; i++) {
{
if ( (i & 0x07) == 0 ) if ( (i & 0x07) == 0 )
printk(BIOS_EMERG, "\n%p:\t", code + i); printk(BIOS_EMERG, "\n%p:\t", code + i);
printk(BIOS_EMERG, "%.2x ", code[i]); printk(BIOS_EMERG, "%.2x ", code[i]);

View File

@ -54,9 +54,8 @@ static void sanitize_cmos(void)
if (cmos_default) { if (cmos_default) {
int i; int i;
cmos_disable_rtc(); cmos_disable_rtc();
for (i = 14; i < 128; i++) { for (i = 14; i < 128; i++)
cmos_write_inner(cmos_default[i], i); cmos_write_inner(cmos_default[i], i);
}
cmos_enable_rtc(); cmos_enable_rtc();
} }
} }

View File

@ -306,9 +306,8 @@ static inline pci_devfn_t pci_io_locate_device(unsigned pci_id, pci_devfn_t dev)
for (; dev <= PCI_DEV(255, 31, 7); dev += PCI_DEV(0,0,1)) { for (; dev <= PCI_DEV(255, 31, 7); dev += PCI_DEV(0,0,1)) {
unsigned int id; unsigned int id;
id = pci_io_read_config32(dev, 0); id = pci_io_read_config32(dev, 0);
if (id == pci_id) { if (id == pci_id)
return dev; return dev;
}
} }
return PCI_DEV_INVALID; return PCI_DEV_INVALID;
} }
@ -318,9 +317,8 @@ static inline pci_devfn_t pci_locate_device(unsigned pci_id, pci_devfn_t dev)
for (; dev <= PCI_DEV(255, 31, 7); dev += PCI_DEV(0,0,1)) { for (; dev <= PCI_DEV(255, 31, 7); dev += PCI_DEV(0,0,1)) {
unsigned int id; unsigned int id;
id = pci_read_config32(dev, 0); id = pci_read_config32(dev, 0);
if (id == pci_id) { if (id == pci_id)
return dev; return dev;
}
} }
return PCI_DEV_INVALID; return PCI_DEV_INVALID;
} }
@ -335,9 +333,8 @@ static inline pci_devfn_t pci_locate_device_on_bus(unsigned pci_id, unsigned bus
for (; dev <=last; dev += PCI_DEV(0,0,1)) { for (; dev <=last; dev += PCI_DEV(0,0,1)) {
unsigned int id; unsigned int id;
id = pci_read_config32(dev, 0); id = pci_read_config32(dev, 0);
if (id == pci_id) { if (id == pci_id)
return dev; return dev;
}
} }
return PCI_DEV_INVALID; return PCI_DEV_INVALID;
} }

View File

@ -39,8 +39,7 @@
#define SMP_FLOATING_TABLE_LEN sizeof(struct intel_mp_floating) #define SMP_FLOATING_TABLE_LEN sizeof(struct intel_mp_floating)
struct intel_mp_floating struct intel_mp_floating {
{
char mpf_signature[4]; /* "_MP_" */ char mpf_signature[4]; /* "_MP_" */
u32 mpf_physptr; /* Configuration table address */ u32 mpf_physptr; /* Configuration table address */
u8 mpf_length; /* Our length (paragraphs) */ u8 mpf_length; /* Our length (paragraphs) */
@ -55,8 +54,7 @@ struct intel_mp_floating
u8 mpf_feature5; /* Unused (0) */ u8 mpf_feature5; /* Unused (0) */
} __attribute__((packed)); } __attribute__((packed));
struct mp_config_table struct mp_config_table {
{
char mpc_signature[4]; char mpc_signature[4];
#define MPC_SIGNATURE "PCMP" #define MPC_SIGNATURE "PCMP"
u16 mpc_length; /* Size of table */ u16 mpc_length; /* Size of table */
@ -81,8 +79,7 @@ struct mp_config_table
#define MP_INTSRC 3 #define MP_INTSRC 3
#define MP_LINTSRC 4 #define MP_LINTSRC 4
struct mpc_config_processor struct mpc_config_processor {
{
u8 mpc_type; u8 mpc_type;
u8 mpc_apicid; /* Local APIC number */ u8 mpc_apicid; /* Local APIC number */
u8 mpc_apicver; /* Its versions */ u8 mpc_apicver; /* Its versions */
@ -97,8 +94,7 @@ struct mpc_config_processor
u32 mpc_reserved[2]; u32 mpc_reserved[2];
} __attribute__((packed)); } __attribute__((packed));
struct mpc_config_bus struct mpc_config_bus {
{
u8 mpc_type; u8 mpc_type;
u8 mpc_busid; u8 mpc_busid;
u8 mpc_bustype[6]; u8 mpc_bustype[6];
@ -112,8 +108,7 @@ struct mpc_config_bus
#define BUSTYPE_PCI "PCI" #define BUSTYPE_PCI "PCI"
#define BUSTYPE_PCMCIA "PCMCIA" #define BUSTYPE_PCMCIA "PCMCIA"
struct mpc_config_ioapic struct mpc_config_ioapic {
{
u8 mpc_type; u8 mpc_type;
u8 mpc_apicid; u8 mpc_apicid;
u8 mpc_apicver; u8 mpc_apicver;
@ -122,8 +117,7 @@ struct mpc_config_ioapic
void *mpc_apicaddr; void *mpc_apicaddr;
} __attribute__((packed)); } __attribute__((packed));
struct mpc_config_intsrc struct mpc_config_intsrc {
{
u8 mpc_type; u8 mpc_type;
u8 mpc_irqtype; u8 mpc_irqtype;
u16 mpc_irqflag; u16 mpc_irqflag;
@ -150,8 +144,7 @@ enum mp_irq_source_types {
#define MP_IRQ_TRIGGER_MASK 0xc #define MP_IRQ_TRIGGER_MASK 0xc
struct mpc_config_lintsrc struct mpc_config_lintsrc {
{
u8 mpc_type; u8 mpc_type;
u8 mpc_irqtype; u8 mpc_irqtype;
u16 mpc_irqflag; u16 mpc_irqflag;

View File

@ -63,9 +63,8 @@ static unsigned char smp_compute_checksum(void *v, int len)
int i; int i;
bytes = v; bytes = v;
checksum = 0; checksum = 0;
for (i = 0; i < len; i++) { for (i = 0; i < len; i++)
checksum -= bytes[i]; checksum -= bytes[i];
}
return checksum; return checksum;
} }
@ -443,7 +442,9 @@ void mptable_add_isa_interrupts(struct mp_config_table *mc, unsigned long bus_is
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, bus_isa, 0xf, apicid, 0xf); smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, bus_isa, 0xf, apicid, 0xf);
} }
void mptable_write_buses(struct mp_config_table *mc, int *max_pci_bus, int *isa_bus) { void mptable_write_buses(struct mp_config_table *mc, int *max_pci_bus,
int *isa_bus)
{
int dummy, i, highest; int dummy, i, highest;
char buses[256]; char buses[256];
struct device *dev; struct device *dev;

View File

@ -100,8 +100,7 @@ static u8 pirq_get_next_free_irq(u8* pirq, u16 bitmap)
{ {
int i, link; int i, link;
u8 irq = 0; u8 irq = 0;
for (i = 2; i <= 15; i++) for (i = 2; i <= 15; i++) {
{
/* Can we assign this IRQ ? */ /* Can we assign this IRQ ? */
if (!((bitmap >> i) & 1)) if (!((bitmap >> i) & 1))
continue; continue;
@ -161,13 +160,11 @@ static void pirq_route_irqs(unsigned long addr)
} }
/* yet not routed */ /* yet not routed */
if (!pirq[link - 1]) if (!pirq[link - 1]) {
{
irq = pirq_get_next_free_irq(pirq, bitmap); irq = pirq_get_next_free_irq(pirq, bitmap);
if (irq) if (irq)
pirq[link - 1] = irq; pirq[link - 1] = irq;
} } else
else
irq = pirq[link - 1]; irq = pirq[link - 1];
printk(BIOS_DEBUG, "IRQ: %d\n", irq); printk(BIOS_DEBUG, "IRQ: %d\n", irq);

View File

@ -416,11 +416,10 @@ static int smbios_write_type3(unsigned long *current, int handle)
t->bootup_state = SMBIOS_STATE_SAFE; t->bootup_state = SMBIOS_STATE_SAFE;
t->power_supply_state = SMBIOS_STATE_SAFE; t->power_supply_state = SMBIOS_STATE_SAFE;
t->thermal_state = SMBIOS_STATE_SAFE; t->thermal_state = SMBIOS_STATE_SAFE;
if (IS_ENABLED(CONFIG_SYSTEM_TYPE_LAPTOP)) { if (IS_ENABLED(CONFIG_SYSTEM_TYPE_LAPTOP))
t->_type = SMBIOS_ENCLOSURE_NOTEBOOK; t->_type = SMBIOS_ENCLOSURE_NOTEBOOK;
} else { else
t->_type = SMBIOS_ENCLOSURE_DESKTOP; t->_type = SMBIOS_ENCLOSURE_DESKTOP;
}
t->security_status = SMBIOS_STATE_SAFE; t->security_status = SMBIOS_STATE_SAFE;
len = t->length + smbios_string_table_len(t->eos); len = t->length + smbios_string_table_len(t->eos);
*current += len; *current += len;
@ -437,9 +436,8 @@ static int smbios_write_type4(unsigned long *current, int handle)
res.eax = res.edx = 0; res.eax = res.edx = 0;
res.ebx = 0x10000; res.ebx = 0x10000;
if (cpu_have_cpuid()) { if (cpu_have_cpuid())
res = cpuid(1); res = cpuid(1);
}
memset(t, 0, sizeof(struct smbios_type4)); memset(t, 0, sizeof(struct smbios_type4));
t->type = SMBIOS_PROCESSOR_INFORMATION; t->type = SMBIOS_PROCESSOR_INFORMATION;

View File

@ -47,9 +47,9 @@ static unsigned long write_pirq_table(unsigned long rom_table_end)
new_high_table_pointer = write_pirq_routing_table(high_table_pointer); new_high_table_pointer = write_pirq_routing_table(high_table_pointer);
// FIXME make pirq table code intelligent enough to know how // FIXME make pirq table code intelligent enough to know how
// much space it's going to need. // much space it's going to need.
if (new_high_table_pointer > (high_table_pointer + MAX_PIRQ_TABLE_SIZE)) { if (new_high_table_pointer > (high_table_pointer
+ MAX_PIRQ_TABLE_SIZE))
printk(BIOS_ERR, "ERROR: Increase PIRQ size.\n"); printk(BIOS_ERR, "ERROR: Increase PIRQ size.\n");
}
printk(BIOS_DEBUG, "PIRQ table: %ld bytes.\n", printk(BIOS_DEBUG, "PIRQ table: %ld bytes.\n",
new_high_table_pointer - high_table_pointer); new_high_table_pointer - high_table_pointer);
} }
@ -74,9 +74,9 @@ static unsigned long write_mptable(unsigned long rom_table_end)
new_high_table_pointer = write_smp_table(high_table_pointer); new_high_table_pointer = write_smp_table(high_table_pointer);
// FIXME make mp table code intelligent enough to know how // FIXME make mp table code intelligent enough to know how
// much space it's going to need. // much space it's going to need.
if (new_high_table_pointer > (high_table_pointer + MAX_MP_TABLE_SIZE)) { if (new_high_table_pointer > (high_table_pointer
+ MAX_MP_TABLE_SIZE))
printk(BIOS_ERR, "ERROR: Increase MP table size.\n"); printk(BIOS_ERR, "ERROR: Increase MP table size.\n");
}
printk(BIOS_DEBUG, "MP table: %ld bytes.\n", printk(BIOS_DEBUG, "MP table: %ld bytes.\n",
new_high_table_pointer - high_table_pointer); new_high_table_pointer - high_table_pointer);
@ -112,9 +112,9 @@ static unsigned long write_acpi_table(unsigned long rom_table_end)
rom_table_end = ALIGN(rom_table_end, 16); rom_table_end = ALIGN(rom_table_end, 16);
new_high_table_pointer = write_acpi_tables(high_table_pointer); new_high_table_pointer = write_acpi_tables(high_table_pointer);
if (new_high_table_pointer > ( high_table_pointer + MAX_ACPI_SIZE)) { if (new_high_table_pointer > ( high_table_pointer
+ MAX_ACPI_SIZE))
printk(BIOS_ERR, "ERROR: Increase ACPI size\n"); printk(BIOS_ERR, "ERROR: Increase ACPI size\n");
}
printk(BIOS_DEBUG, "ACPI tables: %ld bytes.\n", printk(BIOS_DEBUG, "ACPI tables: %ld bytes.\n",
new_high_table_pointer - high_table_pointer); new_high_table_pointer - high_table_pointer);
@ -122,9 +122,9 @@ static unsigned long write_acpi_table(unsigned long rom_table_end)
/* First we look for the high table RSDP */ /* First we look for the high table RSDP */
while (acpi_start < new_high_table_pointer) { while (acpi_start < new_high_table_pointer) {
if (memcmp(((acpi_rsdp_t *)acpi_start)->signature, RSDP_SIG, 8) == 0) { if (memcmp(((acpi_rsdp_t *)acpi_start)->signature,
RSDP_SIG, 8) == 0)
break; break;
}
acpi_start++; acpi_start++;
} }
@ -165,9 +165,9 @@ static unsigned long write_smbios_table(unsigned long rom_table_end)
memcpy((void *)rom_table_end, (void *)high_table_pointer, sizeof(struct smbios_entry)); memcpy((void *)rom_table_end, (void *)high_table_pointer, sizeof(struct smbios_entry));
rom_table_end += sizeof(struct smbios_entry); rom_table_end += sizeof(struct smbios_entry);
if (new_high_table_pointer > ( high_table_pointer + MAX_SMBIOS_SIZE)) { if (new_high_table_pointer > ( high_table_pointer
+ MAX_SMBIOS_SIZE))
printk(BIOS_ERR, "ERROR: Increase SMBIOS size\n"); printk(BIOS_ERR, "ERROR: Increase SMBIOS size\n");
}
printk(BIOS_DEBUG, "SMBIOS tables: %ld bytes.\n", printk(BIOS_DEBUG, "SMBIOS tables: %ld bytes.\n",
new_high_table_pointer - high_table_pointer); new_high_table_pointer - high_table_pointer);
} else { } else {