apic: moved declaration outside of switch statement

This commit is contained in:
Michael Shaw 2023-02-28 23:00:01 -05:00
commit f4f4d3150e

View file

@ -45,9 +45,11 @@ int madt_parse_next_entry(int offset)
printf(LOG_INFO "MADT Entry %d: %s\n", n_madt_entries,
madt_entry_types[type]);
/* Can't declare variables inside switch statement */
struct madt_lapic *lapic = (struct madt_lapic *)madt;
switch (type) {
case MADT_LAPIC:
struct madt_lapic *lapic = (struct madt_lapic *)madt;
printf(LOG_INFO "Lapic base address for cpu %d: %xh\n",
lapic->acpi_cpu_id, __madt->lapic_addr);
break;