From a15d8af140528df440617c074136d32be28e4976 Mon Sep 17 00:00:00 2001 From: Lee Leahy Date: Wed, 15 Mar 2017 14:49:35 -0700 Subject: cpu/x86: Remove braces and else if unnecessary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the following warnings detected by checkpatch.pl WARNING: braces {} are not necessary for single statement blocks WARNING: braces {} are not necessary for any arm of this statement WARNING: else is not generally useful after a break or return TEST=Build and run on Galileo Gen2 Change-Id: I2d6b22c66d52f5f2d24b15270ad4b52894adebc2 Signed-off-by: Lee Leahy Reviewed-on: https://review.coreboot.org/18842 Tested-by: build bot (Jenkins) Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Martin Roth --- src/cpu/x86/lapic/lapic_cpu_init.c | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) (limited to 'src/cpu/x86/lapic') diff --git a/src/cpu/x86/lapic/lapic_cpu_init.c b/src/cpu/x86/lapic/lapic_cpu_init.c index ff1a11438c..69710a29da 100644 --- a/src/cpu/x86/lapic/lapic_cpu_init.c +++ b/src/cpu/x86/lapic/lapic_cpu_init.c @@ -437,26 +437,22 @@ static void start_other_cpus(struct bus *cpu_bus, struct device *bsp_cpu) /* Loop through the cpus once getting them started */ for (cpu = cpu_bus->children; cpu; cpu = cpu->sibling) { - if (cpu->path.type != DEVICE_PATH_APIC) { + if (cpu->path.type != DEVICE_PATH_APIC) continue; - } if (IS_ENABLED(CONFIG_PARALLEL_CPU_INIT) && (cpu == bsp_cpu)) continue; - if (!cpu->enabled) { + if (!cpu->enabled) continue; - } - if (cpu->initialized) { + if (cpu->initialized) continue; - } - if (!start_cpu(cpu)) { + if (!start_cpu(cpu)) /* Record the error in cpu? */ printk(BIOS_ERR, "CPU 0x%02x would not start!\n", cpu->path.apic.apic_id); - } if (!IS_ENABLED(CONFIG_PARALLEL_CPU_INIT)) udelay(10); @@ -472,9 +468,8 @@ static void smm_other_cpus(struct bus *cpu_bus, device_t bsp_cpu) /* Loop through the cpus once to let them run through SMM relocator */ for (cpu = cpu_bus->children; cpu; cpu = cpu->sibling) { - if (cpu->path.type != DEVICE_PATH_APIC) { + if (cpu->path.type != DEVICE_PATH_APIC) continue; - } printk(BIOS_ERR, "considering CPU 0x%02x for SMM init\n", cpu->path.apic.apic_id); @@ -482,15 +477,13 @@ static void smm_other_cpus(struct bus *cpu_bus, device_t bsp_cpu) if (cpu == bsp_cpu) continue; - if (!cpu->enabled) { + if (!cpu->enabled) continue; - } - if (!start_cpu(cpu)) { + if (!start_cpu(cpu)) /* Record the error in cpu? */ printk(BIOS_ERR, "CPU 0x%02x would not start!\n", cpu->path.apic.apic_id); - } /* FIXME: endless loop */ while (atomic_read(&active_cpus) != pre_count); @@ -518,16 +511,13 @@ static void wait_other_cpus_stop(struct bus *cpu_bus) loopcount++; } for (cpu = cpu_bus->children; cpu; cpu = cpu->sibling) { - if (cpu->path.type != DEVICE_PATH_APIC) { + if (cpu->path.type != DEVICE_PATH_APIC) continue; - } - if (cpu->path.apic.apic_id == SPEEDSTEP_APIC_MAGIC) { + if (cpu->path.apic.apic_id == SPEEDSTEP_APIC_MAGIC) continue; - } - if (!cpu->initialized) { + if (!cpu->initialized) printk(BIOS_ERR, "CPU 0x%02x did not initialize!\n", cpu->path.apic.apic_id); - } } printk(BIOS_DEBUG, "All AP CPUs stopped (%ld loops)\n", loopcount); checkstack(_estack, 0); -- cgit v1.2.3