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 <johan.hedberg@intel.com>
diff --git a/arch/x86/core/intel64/cpu.c b/arch/x86/core/intel64/cpu.c
index 6afcec2..a522e87 100644
--- a/arch/x86/core/intel64/cpu.c
+++ b/arch/x86/core/intel64/cpu.c
@@ -144,14 +144,14 @@
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_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;
- }
-#endif
+ 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];