ACPI: tables: Simplify PPTT leaf node detection
authorJeremy Linton <jeremy.linton@arm.com>
Fri, 1 Mar 2019 18:52:21 +0000 (12:52 -0600)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 11 Mar 2019 11:14:57 +0000 (12:14 +0100)
ACPI 6.3 bumps the PPTT table revision and adds a LEAF_NODE flag.

This allows us to avoid a second pass through the table to assure
that the node in question is a leaf.

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/pptt.c

index ad31c50de3be8582f483057efcae8d2476552f45..065c4fc245d117ff84b938790c232bbf555c0cb8 100644 (file)
@@ -209,6 +209,9 @@ static int acpi_pptt_leaf_node(struct acpi_table_header *table_hdr,
        struct acpi_pptt_processor *cpu_node;
        u32 proc_sz;
 
+       if (table_hdr->revision > 1)
+               return (node->flags & ACPI_PPTT_ACPI_LEAF_NODE);
+
        table_end = (unsigned long)table_hdr + table_hdr->length;
        node_entry = ACPI_PTR_DIFF(node, table_hdr);
        entry = ACPI_ADD_PTR(struct acpi_subtable_header, table_hdr,