diff options
author | Bob Moore <robert.moore@intel.com> | 2019-04-08 13:42:25 -0700 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2019-04-09 11:24:48 +0200 |
commit | 3278675567dfb901d831d46849c386a4f932905e (patch) | |
tree | 9e92ebc6684f6b3f301a4a923cdd3a4cfa78cf78 /tools/power/acpi | |
parent | 5599fb69355d7a558f32206dac7539e945a1f604 (diff) |
ACPICA: Rename nameseg length macro/define for clarity
ACPICA commit 24870bd9e73d71e2a1ff0a1e94519f8f8409e57d
ACPI_NAME_SIZE changed to ACPI_NAMESEG_SIZE
This clarifies that this is the length of an individual
nameseg, not the length of a generic namestring/namepath.
Improves understanding of the code.
Link: https://github.com/acpica/acpica/commit/24870bd9
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>
Diffstat (limited to 'tools/power/acpi')
-rw-r--r-- | tools/power/acpi/os_specific/service_layers/oslinuxtbl.c | 14 | ||||
-rw-r--r-- | tools/power/acpi/tools/acpidump/apdump.c | 4 | ||||
-rw-r--r-- | tools/power/acpi/tools/acpidump/apfiles.c | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c index 2686d858225a..d1f3d44e315e 100644 --- a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c +++ b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c @@ -19,7 +19,7 @@ ACPI_MODULE_NAME("oslinuxtbl") typedef struct osl_table_info { struct osl_table_info *next; u32 instance; - char signature[ACPI_NAME_SIZE]; + char signature[ACPI_NAMESEG_SIZE]; } osl_table_info; @@ -995,7 +995,7 @@ static acpi_status osl_list_customized_tables(char *directory) { void *table_dir; u32 instance; - char temp_name[ACPI_NAME_SIZE]; + char temp_name[ACPI_NAMESEG_SIZE]; char *filename; acpi_status status = AE_OK; @@ -1158,15 +1158,15 @@ osl_table_name_from_file(char *filename, char *signature, u32 *instance) /* Ignore meaningless files */ - if (strlen(filename) < ACPI_NAME_SIZE) { + if (strlen(filename) < ACPI_NAMESEG_SIZE) { return (AE_BAD_SIGNATURE); } /* Extract instance number */ - if (isdigit((int)filename[ACPI_NAME_SIZE])) { - sscanf(&filename[ACPI_NAME_SIZE], "%u", instance); - } else if (strlen(filename) != ACPI_NAME_SIZE) { + if (isdigit((int)filename[ACPI_NAMESEG_SIZE])) { + sscanf(&filename[ACPI_NAMESEG_SIZE], "%u", instance); + } else if (strlen(filename) != ACPI_NAMESEG_SIZE) { return (AE_BAD_SIGNATURE); } else { *instance = 0; @@ -1311,7 +1311,7 @@ osl_get_customized_table(char *pathname, { void *table_dir; u32 current_instance = 0; - char temp_name[ACPI_NAME_SIZE]; + char temp_name[ACPI_NAMESEG_SIZE]; char table_filename[PATH_MAX]; char *filename; acpi_status status; diff --git a/tools/power/acpi/tools/acpidump/apdump.c b/tools/power/acpi/tools/acpidump/apdump.c index 9dfcc0329d34..820baeb5092b 100644 --- a/tools/power/acpi/tools/acpidump/apdump.c +++ b/tools/power/acpi/tools/acpidump/apdump.c @@ -289,14 +289,14 @@ int ap_dump_table_by_address(char *ascii_address) int ap_dump_table_by_name(char *signature) { - char local_signature[ACPI_NAME_SIZE + 1]; + char local_signature[ACPI_NAMESEG_SIZE + 1]; u32 instance; struct acpi_table_header *table; acpi_physical_address address; acpi_status status; int table_status; - if (strlen(signature) != ACPI_NAME_SIZE) { + if (strlen(signature) != ACPI_NAMESEG_SIZE) { fprintf(stderr, "Invalid table signature [%s]: must be exactly 4 characters\n", signature); diff --git a/tools/power/acpi/tools/acpidump/apfiles.c b/tools/power/acpi/tools/acpidump/apfiles.c index 8abc8f998abd..a42cfcaa3293 100644 --- a/tools/power/acpi/tools/acpidump/apfiles.c +++ b/tools/power/acpi/tools/acpidump/apfiles.c @@ -97,7 +97,7 @@ int ap_open_output_file(char *pathname) int ap_write_to_binary_file(struct acpi_table_header *table, u32 instance) { - char filename[ACPI_NAME_SIZE + 16]; + char filename[ACPI_NAMESEG_SIZE + 16]; char instance_str[16]; ACPI_FILE file; acpi_size actual; @@ -119,7 +119,7 @@ int ap_write_to_binary_file(struct acpi_table_header *table, u32 instance) filename[1] = (char)tolower((int)filename[1]); filename[2] = (char)tolower((int)filename[2]); filename[3] = (char)tolower((int)filename[3]); - filename[ACPI_NAME_SIZE] = 0; + filename[ACPI_NAMESEG_SIZE] = 0; /* Handle multiple SSDts - create different filenames for each */ |