Commit 5599fb69 authored by Bob Moore's avatar Bob Moore Committed by Rafael J. Wysocki

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/92ec0935Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarErik Schmauss <erik.schmauss@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent a3ce7a8e
...@@ -276,7 +276,7 @@ static unsigned long get_acpi_srat_table(void) ...@@ -276,7 +276,7 @@ static unsigned long get_acpi_srat_table(void)
if (acpi_table) { if (acpi_table) {
header = (struct acpi_table_header *)acpi_table; header = (struct acpi_table_header *)acpi_table;
if (ACPI_COMPARE_NAME(header->signature, ACPI_SIG_SRAT)) if (ACPI_COMPARE_NAMESEG(header->signature, ACPI_SIG_SRAT))
return acpi_table; return acpi_table;
} }
entry += size; entry += size;
......
...@@ -453,7 +453,7 @@ acpi_db_execute(char *name, char **args, acpi_object_type *types, u32 flags) ...@@ -453,7 +453,7 @@ acpi_db_execute(char *name, char **args, acpi_object_type *types, u32 flags)
/* Dump a _PLD buffer if present */ /* Dump a _PLD buffer if present */
if (ACPI_COMPARE_NAME if (ACPI_COMPARE_NAMESEG
((ACPI_CAST_PTR ((ACPI_CAST_PTR
(struct acpi_namespace_node, (struct acpi_namespace_node,
acpi_gbl_db_method_info.method)->name.ascii), acpi_gbl_db_method_info.method)->name.ascii),
......
...@@ -200,7 +200,7 @@ acpi_ds_initialize_objects(u32 table_index, ...@@ -200,7 +200,7 @@ acpi_ds_initialize_objects(u32 table_index,
/* DSDT is always the first AML table */ /* DSDT is always the first AML table */
if (ACPI_COMPARE_NAME(table->signature, ACPI_SIG_DSDT)) { if (ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_DSDT)) {
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
"\nInitializing Namespace objects:\n")); "\nInitializing Namespace objects:\n"));
} }
......
...@@ -478,7 +478,7 @@ acpi_ns_find_ini_methods(acpi_handle obj_handle, ...@@ -478,7 +478,7 @@ acpi_ns_find_ini_methods(acpi_handle obj_handle,
/* We are only looking for methods named _INI */ /* We are only looking for methods named _INI */
if (!ACPI_COMPARE_NAME(node->name.ascii, METHOD_NAME__INI)) { if (!ACPI_COMPARE_NAMESEG(node->name.ascii, METHOD_NAME__INI)) {
return (AE_OK); return (AE_OK);
} }
...@@ -641,7 +641,7 @@ acpi_ns_init_one_device(acpi_handle obj_handle, ...@@ -641,7 +641,7 @@ acpi_ns_init_one_device(acpi_handle obj_handle,
* Note: We know there is an _INI within this subtree, but it may not be * Note: We know there is an _INI within this subtree, but it may not be
* under this particular device, it may be lower in the branch. * under this particular device, it may be lower in the branch.
*/ */
if (!ACPI_COMPARE_NAME(device_node->name.ascii, "_SB_") || if (!ACPI_COMPARE_NAMESEG(device_node->name.ascii, "_SB_") ||
device_node->parent != acpi_gbl_root_node) { device_node->parent != acpi_gbl_root_node) {
ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname
(ACPI_TYPE_METHOD, device_node, (ACPI_TYPE_METHOD, device_node,
......
...@@ -203,7 +203,7 @@ acpi_ns_one_complete_parse(u32 pass_number, ...@@ -203,7 +203,7 @@ acpi_ns_one_complete_parse(u32 pass_number,
/* Found OSDT table, enable the namespace override feature */ /* Found OSDT table, enable the namespace override feature */
if (ACPI_COMPARE_NAME(table->signature, ACPI_SIG_OSDT) && if (ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_OSDT) &&
pass_number == ACPI_IMODE_LOAD_PASS1) { pass_number == ACPI_IMODE_LOAD_PASS1) {
walk_state->namespace_override = TRUE; walk_state->namespace_override = TRUE;
} }
......
...@@ -316,7 +316,7 @@ static const struct acpi_simple_repair_info *acpi_ns_match_simple_repair(struct ...@@ -316,7 +316,7 @@ static const struct acpi_simple_repair_info *acpi_ns_match_simple_repair(struct
this_name = acpi_object_repair_info; this_name = acpi_object_repair_info;
while (this_name->object_converter) { while (this_name->object_converter) {
if (ACPI_COMPARE_NAME(node->name.ascii, this_name->name)) { if (ACPI_COMPARE_NAMESEG(node->name.ascii, this_name->name)) {
/* Check if we can actually repair this name/type combination */ /* Check if we can actually repair this name/type combination */
......
...@@ -188,7 +188,7 @@ static const struct acpi_repair_info *acpi_ns_match_complex_repair(struct ...@@ -188,7 +188,7 @@ static const struct acpi_repair_info *acpi_ns_match_complex_repair(struct
this_name = acpi_ns_repairable_names; this_name = acpi_ns_repairable_names;
while (this_name->repair_function) { while (this_name->repair_function) {
if (ACPI_COMPARE_NAME(node->name.ascii, this_name->name)) { if (ACPI_COMPARE_NAMESEG(node->name.ascii, this_name->name)) {
return (this_name); return (this_name);
} }
......
...@@ -495,8 +495,8 @@ acpi_status acpi_install_method(u8 *buffer) ...@@ -495,8 +495,8 @@ acpi_status acpi_install_method(u8 *buffer)
/* Table must be a DSDT or SSDT */ /* Table must be a DSDT or SSDT */
if (!ACPI_COMPARE_NAME(table->signature, ACPI_SIG_DSDT) && if (!ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_DSDT) &&
!ACPI_COMPARE_NAME(table->signature, ACPI_SIG_SSDT)) { !ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_SSDT)) {
return (AE_BAD_HEADER); return (AE_BAD_HEADER);
} }
......
...@@ -603,10 +603,10 @@ acpi_walk_resources(acpi_handle device_handle, ...@@ -603,10 +603,10 @@ acpi_walk_resources(acpi_handle device_handle,
/* Parameter validation */ /* Parameter validation */
if (!device_handle || !user_function || !name || if (!device_handle || !user_function || !name ||
(!ACPI_COMPARE_NAME(name, METHOD_NAME__CRS) && (!ACPI_COMPARE_NAMESEG(name, METHOD_NAME__CRS) &&
!ACPI_COMPARE_NAME(name, METHOD_NAME__PRS) && !ACPI_COMPARE_NAMESEG(name, METHOD_NAME__PRS) &&
!ACPI_COMPARE_NAME(name, METHOD_NAME__AEI) && !ACPI_COMPARE_NAMESEG(name, METHOD_NAME__AEI) &&
!ACPI_COMPARE_NAME(name, METHOD_NAME__DMA))) { !ACPI_COMPARE_NAMESEG(name, METHOD_NAME__DMA))) {
return_ACPI_STATUS(AE_BAD_PARAMETER); return_ACPI_STATUS(AE_BAD_PARAMETER);
} }
......
...@@ -480,7 +480,8 @@ acpi_tb_verify_temp_table(struct acpi_table_desc *table_desc, ...@@ -480,7 +480,8 @@ acpi_tb_verify_temp_table(struct acpi_table_desc *table_desc,
/* If a particular signature is expected (DSDT/FACS), it must match */ /* If a particular signature is expected (DSDT/FACS), it must match */
if (signature && !ACPI_COMPARE_NAME(&table_desc->signature, signature)) { if (signature &&
!ACPI_COMPARE_NAMESEG(&table_desc->signature, signature)) {
ACPI_BIOS_ERROR((AE_INFO, ACPI_BIOS_ERROR((AE_INFO,
"Invalid signature 0x%X for ACPI table, expected [%s]", "Invalid signature 0x%X for ACPI table, expected [%s]",
table_desc->signature.integer, signature)); table_desc->signature.integer, signature));
......
...@@ -120,7 +120,7 @@ acpi_tb_install_standard_table(acpi_physical_address address, ...@@ -120,7 +120,7 @@ acpi_tb_install_standard_table(acpi_physical_address address,
*/ */
if (!reload && if (!reload &&
acpi_gbl_disable_ssdt_table_install && acpi_gbl_disable_ssdt_table_install &&
ACPI_COMPARE_NAME(&new_table_desc.signature, ACPI_SIG_SSDT)) { ACPI_COMPARE_NAMESEG(&new_table_desc.signature, ACPI_SIG_SSDT)) {
ACPI_INFO(("Ignoring installation of %4.4s at %8.8X%8.8X", ACPI_INFO(("Ignoring installation of %4.4s at %8.8X%8.8X",
new_table_desc.signature.ascii, new_table_desc.signature.ascii,
ACPI_FORMAT_UINT64(address))); ACPI_FORMAT_UINT64(address)));
......
...@@ -94,7 +94,7 @@ acpi_tb_print_table_header(acpi_physical_address address, ...@@ -94,7 +94,7 @@ acpi_tb_print_table_header(acpi_physical_address address,
{ {
struct acpi_table_header local_header; struct acpi_table_header local_header;
if (ACPI_COMPARE_NAME(header->signature, ACPI_SIG_FACS)) { if (ACPI_COMPARE_NAMESEG(header->signature, ACPI_SIG_FACS)) {
/* FACS only has signature and length fields */ /* FACS only has signature and length fields */
...@@ -158,8 +158,8 @@ acpi_status acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length) ...@@ -158,8 +158,8 @@ acpi_status acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length)
* They are the odd tables, have no standard ACPI header and no checksum * They are the odd tables, have no standard ACPI header and no checksum
*/ */
if (ACPI_COMPARE_NAME(table->signature, ACPI_SIG_S3PT) || if (ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_S3PT) ||
ACPI_COMPARE_NAME(table->signature, ACPI_SIG_FACS)) { ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_FACS)) {
return (AE_OK); return (AE_OK);
} }
......
...@@ -332,9 +332,9 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address) ...@@ -332,9 +332,9 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
&table_index); &table_index);
if (ACPI_SUCCESS(status) && if (ACPI_SUCCESS(status) &&
ACPI_COMPARE_NAME(&acpi_gbl_root_table_list. ACPI_COMPARE_NAMESEG(&acpi_gbl_root_table_list.
tables[table_index].signature, tables[table_index].signature,
ACPI_SIG_FADT)) { ACPI_SIG_FADT)) {
acpi_gbl_fadt_index = table_index; acpi_gbl_fadt_index = table_index;
acpi_tb_parse_fadt(); acpi_tb_parse_fadt();
} }
......
...@@ -230,7 +230,7 @@ acpi_get_table_header(char *signature, ...@@ -230,7 +230,7 @@ acpi_get_table_header(char *signature,
for (i = 0, j = 0; i < acpi_gbl_root_table_list.current_table_count; for (i = 0, j = 0; i < acpi_gbl_root_table_list.current_table_count;
i++) { i++) {
if (!ACPI_COMPARE_NAME if (!ACPI_COMPARE_NAMESEG
(&(acpi_gbl_root_table_list.tables[i].signature), (&(acpi_gbl_root_table_list.tables[i].signature),
signature)) { signature)) {
continue; continue;
...@@ -323,7 +323,7 @@ acpi_get_table(char *signature, ...@@ -323,7 +323,7 @@ acpi_get_table(char *signature,
i++) { i++) {
table_desc = &acpi_gbl_root_table_list.tables[i]; table_desc = &acpi_gbl_root_table_list.tables[i];
if (!ACPI_COMPARE_NAME(&table_desc->signature, signature)) { if (!ACPI_COMPARE_NAMESEG(&table_desc->signature, signature)) {
continue; continue;
} }
......
...@@ -118,7 +118,7 @@ acpi_status acpi_tb_load_namespace(void) ...@@ -118,7 +118,7 @@ acpi_status acpi_tb_load_namespace(void)
table = &acpi_gbl_root_table_list.tables[acpi_gbl_dsdt_index]; table = &acpi_gbl_root_table_list.tables[acpi_gbl_dsdt_index];
if (!acpi_gbl_root_table_list.current_table_count || if (!acpi_gbl_root_table_list.current_table_count ||
!ACPI_COMPARE_NAME(table->signature.ascii, ACPI_SIG_DSDT) || !ACPI_COMPARE_NAMESEG(table->signature.ascii, ACPI_SIG_DSDT) ||
ACPI_FAILURE(acpi_tb_validate_table(table))) { ACPI_FAILURE(acpi_tb_validate_table(table))) {
status = AE_NO_ACPI_TABLES; status = AE_NO_ACPI_TABLES;
goto unlock_and_exit; goto unlock_and_exit;
...@@ -170,11 +170,12 @@ acpi_status acpi_tb_load_namespace(void) ...@@ -170,11 +170,12 @@ acpi_status acpi_tb_load_namespace(void)
table = &acpi_gbl_root_table_list.tables[i]; table = &acpi_gbl_root_table_list.tables[i];
if (!table->address || if (!table->address ||
(!ACPI_COMPARE_NAME(table->signature.ascii, ACPI_SIG_SSDT) (!ACPI_COMPARE_NAMESEG
&& !ACPI_COMPARE_NAME(table->signature.ascii, (table->signature.ascii, ACPI_SIG_SSDT)
ACPI_SIG_PSDT) && !ACPI_COMPARE_NAMESEG(table->signature.ascii,
&& !ACPI_COMPARE_NAME(table->signature.ascii, ACPI_SIG_PSDT)
ACPI_SIG_OSDT)) && !ACPI_COMPARE_NAMESEG(table->signature.ascii,
ACPI_SIG_OSDT))
|| ACPI_FAILURE(acpi_tb_validate_table(table))) { || ACPI_FAILURE(acpi_tb_validate_table(table))) {
continue; continue;
} }
...@@ -364,7 +365,7 @@ acpi_status acpi_unload_parent_table(acpi_handle object) ...@@ -364,7 +365,7 @@ acpi_status acpi_unload_parent_table(acpi_handle object)
* only these types can contain AML and thus are the only types * only these types can contain AML and thus are the only types
* that can create namespace objects. * that can create namespace objects.
*/ */
if (ACPI_COMPARE_NAME if (ACPI_COMPARE_NAMESEG
(acpi_gbl_root_table_list.tables[i].signature.ascii, (acpi_gbl_root_table_list.tables[i].signature.ascii,
ACPI_SIG_DSDT)) { ACPI_SIG_DSDT)) {
status = AE_TYPE; status = AE_TYPE;
......
...@@ -59,10 +59,10 @@ u8 acpi_ut_is_aml_table(struct acpi_table_header *table) ...@@ -59,10 +59,10 @@ u8 acpi_ut_is_aml_table(struct acpi_table_header *table)
/* These are the only tables that contain executable AML */ /* These are the only tables that contain executable AML */
if (ACPI_COMPARE_NAME(table->signature, ACPI_SIG_DSDT) || if (ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_DSDT) ||
ACPI_COMPARE_NAME(table->signature, ACPI_SIG_PSDT) || ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_PSDT) ||
ACPI_COMPARE_NAME(table->signature, ACPI_SIG_SSDT) || ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_SSDT) ||
ACPI_COMPARE_NAME(table->signature, ACPI_SIG_OSDT) || ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_OSDT) ||
ACPI_IS_OEM_SIG(table->signature)) { ACPI_IS_OEM_SIG(table->signature)) {
return (TRUE); return (TRUE);
} }
......
...@@ -84,7 +84,7 @@ const union acpi_predefined_info *acpi_ut_match_predefined_method(char *name) ...@@ -84,7 +84,7 @@ const union acpi_predefined_info *acpi_ut_match_predefined_method(char *name)
this_name = acpi_gbl_predefined_methods; this_name = acpi_gbl_predefined_methods;
while (this_name->info.name[0]) { while (this_name->info.name[0]) {
if (ACPI_COMPARE_NAME(name, this_name->info.name)) { if (ACPI_COMPARE_NAMESEG(name, this_name->info.name)) {
return (this_name); return (this_name);
} }
...@@ -201,7 +201,7 @@ const union acpi_predefined_info *acpi_ut_match_resource_name(char *name) ...@@ -201,7 +201,7 @@ const union acpi_predefined_info *acpi_ut_match_resource_name(char *name)
this_name = acpi_gbl_resource_names; this_name = acpi_gbl_resource_names;
while (this_name->info.name[0]) { while (this_name->info.name[0]) {
if (ACPI_COMPARE_NAME(name, this_name->info.name)) { if (ACPI_COMPARE_NAMESEG(name, this_name->info.name)) {
return (this_name); return (this_name);
} }
......
...@@ -141,7 +141,7 @@ void acpi_ut_repair_name(char *name) ...@@ -141,7 +141,7 @@ void acpi_ut_repair_name(char *name)
* Special case for the root node. This can happen if we get an * Special case for the root node. This can happen if we get an
* error during the execution of module-level code. * error during the execution of module-level code.
*/ */
if (ACPI_COMPARE_NAME(name, ACPI_ROOT_PATHNAME)) { if (ACPI_COMPARE_NAMESEG(name, ACPI_ROOT_PATHNAME)) {
return; return;
} }
......
...@@ -2260,7 +2260,7 @@ int __init __acpi_probe_device_table(struct acpi_probe_entry *ap_head, int nr) ...@@ -2260,7 +2260,7 @@ int __init __acpi_probe_device_table(struct acpi_probe_entry *ap_head, int nr)
mutex_lock(&acpi_probe_mutex); mutex_lock(&acpi_probe_mutex);
for (ape = ap_head; nr; ape++, nr--) { for (ape = ap_head; nr; ape++, nr--) {
if (ACPI_COMPARE_NAME(ACPI_SIG_MADT, ape->id)) { if (ACPI_COMPARE_NAMESEG(ACPI_SIG_MADT, ape->id)) {
acpi_probe_count = 0; acpi_probe_count = 0;
acpi_table_parse_madt(ape->type, acpi_match_madt, 0); acpi_table_parse_madt(ape->type, acpi_match_madt, 0);
count += acpi_probe_count; count += acpi_probe_count;
......
...@@ -368,10 +368,10 @@ static int acpi_table_attr_init(struct kobject *tables_obj, ...@@ -368,10 +368,10 @@ static int acpi_table_attr_init(struct kobject *tables_obj,
char instance_str[ACPI_INST_SIZE]; char instance_str[ACPI_INST_SIZE];
sysfs_attr_init(&table_attr->attr.attr); sysfs_attr_init(&table_attr->attr.attr);
ACPI_MOVE_NAME(table_attr->name, table_header->signature); ACPI_COPY_NAMESEG(table_attr->name, table_header->signature);
list_for_each_entry(attr, &acpi_table_attr_list, node) { list_for_each_entry(attr, &acpi_table_attr_list, node) {
if (ACPI_COMPARE_NAME(table_attr->name, attr->name)) if (ACPI_COMPARE_NAMESEG(table_attr->name, attr->name))
if (table_attr->instance < attr->instance) if (table_attr->instance < attr->instance)
table_attr->instance = attr->instance; table_attr->instance = attr->instance;
} }
...@@ -382,7 +382,7 @@ static int acpi_table_attr_init(struct kobject *tables_obj, ...@@ -382,7 +382,7 @@ static int acpi_table_attr_init(struct kobject *tables_obj,
return -ERANGE; return -ERANGE;
} }
ACPI_MOVE_NAME(table_attr->filename, table_header->signature); ACPI_COPY_NAMESEG(table_attr->filename, table_header->signature);
table_attr->filename[ACPI_NAME_SIZE] = '\0'; table_attr->filename[ACPI_NAME_SIZE] = '\0';
if (table_attr->instance > 1 || (table_attr->instance == 1 && if (table_attr->instance > 1 || (table_attr->instance == 1 &&
!acpi_get_table !acpi_get_table
...@@ -484,7 +484,7 @@ static int acpi_table_data_init(struct acpi_table_header *th) ...@@ -484,7 +484,7 @@ static int acpi_table_data_init(struct acpi_table_header *th)
int i; int i;
for (i = 0; i < NUM_ACPI_DATA_OBJS; i++) { for (i = 0; i < NUM_ACPI_DATA_OBJS; i++) {
if (ACPI_COMPARE_NAME(th->signature, acpi_data_objs[i].name)) { if (ACPI_COMPARE_NAMESEG(th->signature, acpi_data_objs[i].name)) {
data_attr = kzalloc(sizeof(*data_attr), GFP_KERNEL); data_attr = kzalloc(sizeof(*data_attr), GFP_KERNEL);
if (!data_attr) if (!data_attr)
return -ENOMEM; return -ENOMEM;
......
...@@ -670,8 +670,8 @@ static void __init acpi_table_initrd_scan(void) ...@@ -670,8 +670,8 @@ static void __init acpi_table_initrd_scan(void)
table_length = table->length; table_length = table->length;
/* Skip RSDT/XSDT which should only be used for override */ /* Skip RSDT/XSDT which should only be used for override */
if (ACPI_COMPARE_NAME(table->signature, ACPI_SIG_RSDT) || if (ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_RSDT) ||
ACPI_COMPARE_NAME(table->signature, ACPI_SIG_XSDT)) { ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_XSDT)) {
acpi_os_unmap_memory(table, ACPI_HEADER_SIZE); acpi_os_unmap_memory(table, ACPI_HEADER_SIZE);
goto next_table; goto next_table;
} }
......
...@@ -515,10 +515,10 @@ typedef u64 acpi_integer; ...@@ -515,10 +515,10 @@ typedef u64 acpi_integer;
/* Optimizations for 4-character (32-bit) acpi_name manipulation */ /* Optimizations for 4-character (32-bit) acpi_name manipulation */
#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
#define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32, (a)) == *ACPI_CAST_PTR (u32, (b))) #define ACPI_COMPARE_NAMESEG(a,b) (*ACPI_CAST_PTR (u32, (a)) == *ACPI_CAST_PTR (u32, (b)))
#define ACPI_COPY_NAMESEG(dest,src) (*ACPI_CAST_PTR (u32, (dest)) = *ACPI_CAST_PTR (u32, (src))) #define ACPI_COPY_NAMESEG(dest,src) (*ACPI_CAST_PTR (u32, (dest)) = *ACPI_CAST_PTR (u32, (src)))
#else #else
#define ACPI_COMPARE_NAME(a,b) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE)) #define ACPI_COMPARE_NAMESEG(a,b) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE))
#define ACPI_COPY_NAMESEG(dest,src) (strncpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE)) #define ACPI_COPY_NAMESEG(dest,src) (strncpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE))
#endif #endif
......
...@@ -293,7 +293,7 @@ static acpi_status osl_add_table_to_list(char *signature, u32 instance) ...@@ -293,7 +293,7 @@ static acpi_status osl_add_table_to_list(char *signature, u32 instance)
} else { } else {
next = gbl_table_list_head; next = gbl_table_list_head;
while (1) { while (1) {
if (ACPI_COMPARE_NAME(next->signature, signature)) { if (ACPI_COMPARE_NAMESEG(next->signature, signature)) {
if (next->instance == instance) { if (next->instance == instance) {
found = TRUE; found = TRUE;
} }
...@@ -782,11 +782,11 @@ osl_get_bios_table(char *signature, ...@@ -782,11 +782,11 @@ osl_get_bios_table(char *signature,
/* Handle special tables whose addresses are not in RSDT/XSDT */ /* Handle special tables whose addresses are not in RSDT/XSDT */
if (ACPI_COMPARE_NAME(signature, ACPI_RSDP_NAME) || if (ACPI_COMPARE_NAMESEG(signature, ACPI_RSDP_NAME) ||
ACPI_COMPARE_NAME(signature, ACPI_SIG_RSDT) || ACPI_COMPARE_NAMESEG(signature, ACPI_SIG_RSDT) ||
ACPI_COMPARE_NAME(signature, ACPI_SIG_XSDT) || ACPI_COMPARE_NAMESEG(signature, ACPI_SIG_XSDT) ||
ACPI_COMPARE_NAME(signature, ACPI_SIG_DSDT) || ACPI_COMPARE_NAMESEG(signature, ACPI_SIG_DSDT) ||
ACPI_COMPARE_NAME(signature, ACPI_SIG_FACS)) { ACPI_COMPARE_NAMESEG(signature, ACPI_SIG_FACS)) {
find_next_instance: find_next_instance:
...@@ -797,7 +797,7 @@ osl_get_bios_table(char *signature, ...@@ -797,7 +797,7 @@ osl_get_bios_table(char *signature,
* careful about the FADT length and validate table addresses. * careful about the FADT length and validate table addresses.
* Note: The 64-bit addresses have priority. * 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 (current_instance < 2) {
if ((gbl_fadt->header.length >= if ((gbl_fadt->header.length >=
MIN_FADT_FOR_XDSDT) && gbl_fadt->Xdsdt MIN_FADT_FOR_XDSDT) && gbl_fadt->Xdsdt
...@@ -815,7 +815,7 @@ osl_get_bios_table(char *signature, ...@@ -815,7 +815,7 @@ osl_get_bios_table(char *signature,
dsdt; dsdt;
} }
} }
} else if (ACPI_COMPARE_NAME(signature, ACPI_SIG_FACS)) { } else if (ACPI_COMPARE_NAMESEG(signature, ACPI_SIG_FACS)) {
if (current_instance < 2) { if (current_instance < 2) {
if ((gbl_fadt->header.length >= if ((gbl_fadt->header.length >=
MIN_FADT_FOR_XFACS) && gbl_fadt->Xfacs MIN_FADT_FOR_XFACS) && gbl_fadt->Xfacs
...@@ -833,7 +833,7 @@ osl_get_bios_table(char *signature, ...@@ -833,7 +833,7 @@ osl_get_bios_table(char *signature,
facs; facs;
} }
} }
} else if (ACPI_COMPARE_NAME(signature, ACPI_SIG_XSDT)) { } else if (ACPI_COMPARE_NAMESEG(signature, ACPI_SIG_XSDT)) {
if (!gbl_revision) { if (!gbl_revision) {
return (AE_BAD_SIGNATURE); return (AE_BAD_SIGNATURE);
} }
...@@ -842,7 +842,7 @@ osl_get_bios_table(char *signature, ...@@ -842,7 +842,7 @@ osl_get_bios_table(char *signature,
(acpi_physical_address)gbl_rsdp. (acpi_physical_address)gbl_rsdp.
xsdt_physical_address; 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) { if (current_instance == 0) {
table_address = table_address =
(acpi_physical_address)gbl_rsdp. (acpi_physical_address)gbl_rsdp.
...@@ -931,7 +931,7 @@ osl_get_bios_table(char *signature, ...@@ -931,7 +931,7 @@ osl_get_bios_table(char *signature,
/* Does this table match the requested signature? */ /* Does this table match the requested signature? */
if (!ACPI_COMPARE_NAME if (!ACPI_COMPARE_NAMESEG
(mapped_table->signature, signature)) { (mapped_table->signature, signature)) {
osl_unmap_table(mapped_table); osl_unmap_table(mapped_table);
mapped_table = NULL; mapped_table = NULL;
...@@ -1086,8 +1086,8 @@ osl_map_table(acpi_size address, ...@@ -1086,8 +1086,8 @@ osl_map_table(acpi_size address,
return (AE_BAD_SIGNATURE); return (AE_BAD_SIGNATURE);
} }
} else } else
if (!ACPI_COMPARE_NAME(signature, mapped_table->signature)) if (!ACPI_COMPARE_NAMESEG
{ (signature, mapped_table->signature)) {
acpi_os_unmap_memory(mapped_table, acpi_os_unmap_memory(mapped_table,
sizeof(struct acpi_table_header)); sizeof(struct acpi_table_header));
return (AE_BAD_SIGNATURE); return (AE_BAD_SIGNATURE);
...@@ -1236,7 +1236,7 @@ osl_read_table_from_file(char *filename, ...@@ -1236,7 +1236,7 @@ osl_read_table_from_file(char *filename,
status = AE_BAD_SIGNATURE; status = AE_BAD_SIGNATURE;
goto exit; goto exit;
} }
} else if (!ACPI_COMPARE_NAME(signature, header.signature)) { } else if (!ACPI_COMPARE_NAMESEG(signature, header.signature)) {
fprintf(stderr, fprintf(stderr,
"Incorrect signature: Expecting %4.4s, found %4.4s\n", "Incorrect signature: Expecting %4.4s, found %4.4s\n",
signature, header.signature); signature, header.signature);
...@@ -1329,7 +1329,7 @@ osl_get_customized_table(char *pathname, ...@@ -1329,7 +1329,7 @@ osl_get_customized_table(char *pathname,
/* Ignore meaningless files */ /* Ignore meaningless files */
if (!ACPI_COMPARE_NAME(filename, signature)) { if (!ACPI_COMPARE_NAMESEG(filename, signature)) {
continue; continue;
} }
......
...@@ -310,9 +310,9 @@ int ap_dump_table_by_name(char *signature) ...@@ -310,9 +310,9 @@ int ap_dump_table_by_name(char *signature)
/* To be friendly, handle tables whose signatures do not match the name */ /* 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); 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); strcpy(local_signature, ACPI_SIG_MADT);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment