Skip to content

Commit

Permalink
arch: x86: Use ACPICA typdef instead of struct name
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johan Hedberg authored and carlescufi committed Nov 6, 2023
1 parent 6e8a1f5 commit f67ecc3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions arch/x86/core/intel64/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down

0 comments on commit f67ecc3

Please sign in to comment.