Skip to content

Commit

Permalink
ACPI: processor: refactor internal map_x2apic_id()
Browse files Browse the repository at this point in the history
Untangle the nested if conditions to make this function look
more similar to the other map_*apic_id() functions.

Acked-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Alex Chiang authored and Len Brown committed Mar 15, 2010
1 parent 1113073 commit d674209
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions drivers/acpi/processor_core.c
Original file line number Diff line number Diff line change
@@ -66,22 +66,16 @@ static int map_x2apic_id(struct acpi_subtable_header *entry,
{
struct acpi_madt_local_x2apic *apic =
(struct acpi_madt_local_x2apic *)entry;
u32 tmp = apic->local_apic_id;

/* Only check enabled APICs*/
if (!(apic->lapic_flags & ACPI_MADT_ENABLED))
return 0;

/* Device statement declaration type */
if (device_declaration) {
if (apic->uid == acpi_id)
goto found;
if (device_declaration && (apic->uid == acpi_id)) {
*apic_id = apic->local_apic_id;
return 1;
}

return 0;
found:
*apic_id = tmp;
return 1;
}

static int map_lsapic_id(struct acpi_subtable_header *entry,

0 comments on commit d674209

Please sign in to comment.