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];