ACPICA: Rename nameseg compare macro for clarity

ACPICA commit 92ec0935f27e217dff0b176fca02c2ec3d782bb5

ACPI_COMPARE_NAME changed to ACPI_COMPARE_NAMESEG
This clarifies (1) this is a compare on 4-byte namesegs, not
a generic compare. Improves understanding of the code.

Link: https://github.com/acpica/acpica/commit/92ec0935
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Bob Moore
2019-04-08 13:42:24 -07:00
committed by Rafael J. Wysocki
parent a3ce7a8e0d
commit 5599fb6935
24 changed files with 66 additions and 64 deletions

View File

@@ -293,7 +293,7 @@ static acpi_status osl_add_table_to_list(char *signature, u32 instance)
} else {
next = gbl_table_list_head;
while (1) {
if (ACPI_COMPARE_NAME(next->signature, signature)) {
if (ACPI_COMPARE_NAMESEG(next->signature, signature)) {
if (next->instance == instance) {
found = TRUE;
}
@@ -782,11 +782,11 @@ osl_get_bios_table(char *signature,
/* Handle special tables whose addresses are not in RSDT/XSDT */
if (ACPI_COMPARE_NAME(signature, ACPI_RSDP_NAME) ||
ACPI_COMPARE_NAME(signature, ACPI_SIG_RSDT) ||
ACPI_COMPARE_NAME(signature, ACPI_SIG_XSDT) ||
ACPI_COMPARE_NAME(signature, ACPI_SIG_DSDT) ||
ACPI_COMPARE_NAME(signature, ACPI_SIG_FACS)) {
if (ACPI_COMPARE_NAMESEG(signature, ACPI_RSDP_NAME) ||
ACPI_COMPARE_NAMESEG(signature, ACPI_SIG_RSDT) ||
ACPI_COMPARE_NAMESEG(signature, ACPI_SIG_XSDT) ||
ACPI_COMPARE_NAMESEG(signature, ACPI_SIG_DSDT) ||
ACPI_COMPARE_NAMESEG(signature, ACPI_SIG_FACS)) {
find_next_instance:
@@ -797,7 +797,7 @@ find_next_instance:
* careful about the FADT length and validate table addresses.
* Note: The 64-bit addresses have priority.
*/
if (ACPI_COMPARE_NAME(signature, ACPI_SIG_DSDT)) {
if (ACPI_COMPARE_NAMESEG(signature, ACPI_SIG_DSDT)) {
if (current_instance < 2) {
if ((gbl_fadt->header.length >=
MIN_FADT_FOR_XDSDT) && gbl_fadt->Xdsdt
@@ -815,7 +815,7 @@ find_next_instance:
dsdt;
}
}
} else if (ACPI_COMPARE_NAME(signature, ACPI_SIG_FACS)) {
} else if (ACPI_COMPARE_NAMESEG(signature, ACPI_SIG_FACS)) {
if (current_instance < 2) {
if ((gbl_fadt->header.length >=
MIN_FADT_FOR_XFACS) && gbl_fadt->Xfacs
@@ -833,7 +833,7 @@ find_next_instance:
facs;
}
}
} else if (ACPI_COMPARE_NAME(signature, ACPI_SIG_XSDT)) {
} else if (ACPI_COMPARE_NAMESEG(signature, ACPI_SIG_XSDT)) {
if (!gbl_revision) {
return (AE_BAD_SIGNATURE);
}
@@ -842,7 +842,7 @@ find_next_instance:
(acpi_physical_address)gbl_rsdp.
xsdt_physical_address;
}
} else if (ACPI_COMPARE_NAME(signature, ACPI_SIG_RSDT)) {
} else if (ACPI_COMPARE_NAMESEG(signature, ACPI_SIG_RSDT)) {
if (current_instance == 0) {
table_address =
(acpi_physical_address)gbl_rsdp.
@@ -931,7 +931,7 @@ find_next_instance:
/* Does this table match the requested signature? */
if (!ACPI_COMPARE_NAME
if (!ACPI_COMPARE_NAMESEG
(mapped_table->signature, signature)) {
osl_unmap_table(mapped_table);
mapped_table = NULL;
@@ -1086,8 +1086,8 @@ osl_map_table(acpi_size address,
return (AE_BAD_SIGNATURE);
}
} else
if (!ACPI_COMPARE_NAME(signature, mapped_table->signature))
{
if (!ACPI_COMPARE_NAMESEG
(signature, mapped_table->signature)) {
acpi_os_unmap_memory(mapped_table,
sizeof(struct acpi_table_header));
return (AE_BAD_SIGNATURE);
@@ -1236,7 +1236,7 @@ osl_read_table_from_file(char *filename,
status = AE_BAD_SIGNATURE;
goto exit;
}
} else if (!ACPI_COMPARE_NAME(signature, header.signature)) {
} else if (!ACPI_COMPARE_NAMESEG(signature, header.signature)) {
fprintf(stderr,
"Incorrect signature: Expecting %4.4s, found %4.4s\n",
signature, header.signature);
@@ -1329,7 +1329,7 @@ osl_get_customized_table(char *pathname,
/* Ignore meaningless files */
if (!ACPI_COMPARE_NAME(filename, signature)) {
if (!ACPI_COMPARE_NAMESEG(filename, signature)) {
continue;
}

View File

@@ -310,9 +310,9 @@ int ap_dump_table_by_name(char *signature)
/* To be friendly, handle tables whose signatures do not match the name */
if (ACPI_COMPARE_NAME(local_signature, "FADT")) {
if (ACPI_COMPARE_NAMESEG(local_signature, "FADT")) {
strcpy(local_signature, ACPI_SIG_FADT);
} else if (ACPI_COMPARE_NAME(local_signature, "MADT")) {
} else if (ACPI_COMPARE_NAMESEG(local_signature, "MADT")) {
strcpy(local_signature, ACPI_SIG_MADT);
}