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: 24870bd9
Signed-off-by: Bob Moore <[email protected]>
Signed-off-by: Erik Schmauss <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
Bob Moore 2019-04-08 13:42:25 -07:00 • committed by Rafael J. Wysocki
commit 3278675567
24 changed files with 61 additions and 61 deletions

View file

@ -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;

View file

@ -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);

View file

@ -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 */