From f67ecc31aa72bce582cd66b48c87e73f01f41e86 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 6 Nov 2023 10:17:46 +0200 Subject: [PATCH] arch: x86: Use ACPICA typdef instead of struct name Use ACPI_MADT_LOCAL_APIC instead of struct acpi_madt_local_apic. In the same go, switch to IF_ENABLED from ifdef - slightly more readable, and this keeps some static analyzers happy (e.g. upstream Compliance check). Signed-off-by: Johan Hedberg --- arch/x86/core/intel64/cpu.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/x86/core/intel64/cpu.c b/arch/x86/core/intel64/cpu.c index 6afcec2a0170d0..a522e87de3a975 100644 --- a/arch/x86/core/intel64/cpu.c +++ b/arch/x86/core/intel64/cpu.c @@ -144,14 +144,14 @@ void arch_start_cpu(int cpu_num, k_thread_stack_t *stack, int sz, uint8_t vector = ((unsigned long) x86_ap_start) >> 12; uint8_t apic_id; -#ifdef CONFIG_ACPI - struct acpi_madt_local_apic *lapic = acpi_local_apic_get(cpu_num); - - if (lapic != NULL) { - /* We update the apic_id, __start will need it. */ - x86_cpu_loapics[cpu_num] = lapic->Id; - } -#endif + IF_ENABLED(CONFIG_ACPI, ({ + ACPI_MADT_LOCAL_APIC *lapic = acpi_local_apic_get(cpu_num); + + if (lapic != NULL) { + /* We update the apic_id, __start will need it. */ + x86_cpu_loapics[cpu_num] = lapic->Id; + } + })); apic_id = x86_cpu_loapics[cpu_num];