Commit ec41f193 authored by Bob Moore's avatar Bob Moore Committed by Len Brown

ACPICA: Formatting update - no functional changes

Split some long lines.
Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLin Ming <ming.m.lin@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 7bcc06e8
...@@ -132,7 +132,8 @@ static struct acpi_fadt_info fadt_info_table[] = { ...@@ -132,7 +132,8 @@ static struct acpi_fadt_info fadt_info_table[] = {
ACPI_FADT_SEPARATE_LENGTH} ACPI_FADT_SEPARATE_LENGTH}
}; };
#define ACPI_FADT_INFO_ENTRIES (sizeof (fadt_info_table) / sizeof (struct acpi_fadt_info)) #define ACPI_FADT_INFO_ENTRIES \
(sizeof (fadt_info_table) / sizeof (struct acpi_fadt_info))
/* Table used to split Event Blocks into separate status/enable registers */ /* Table used to split Event Blocks into separate status/enable registers */
...@@ -161,7 +162,8 @@ static struct acpi_fadt_pm_info fadt_pm_info_table[] = { ...@@ -161,7 +162,8 @@ static struct acpi_fadt_pm_info fadt_pm_info_table[] = {
1} 1}
}; };
#define ACPI_FADT_PM_INFO_ENTRIES (sizeof (fadt_pm_info_table) / sizeof (struct acpi_fadt_pm_info)) #define ACPI_FADT_PM_INFO_ENTRIES \
(sizeof (fadt_pm_info_table) / sizeof (struct acpi_fadt_pm_info))
/******************************************************************************* /*******************************************************************************
* *
...@@ -416,7 +418,7 @@ static void acpi_tb_convert_fadt(void) ...@@ -416,7 +418,7 @@ static void acpi_tb_convert_fadt(void)
} }
} }
/****************************************************************************** /*******************************************************************************
* *
* FUNCTION: acpi_tb_validate_fadt * FUNCTION: acpi_tb_validate_fadt
* *
...@@ -503,7 +505,8 @@ static void acpi_tb_validate_fadt(void) ...@@ -503,7 +505,8 @@ static void acpi_tb_validate_fadt(void)
*/ */
if (!address64->address || !length) { if (!address64->address || !length) {
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Required field %s has zero address and/or length: %8.8X%8.8X/%X", "Required field %s has zero address and/or length:"
" %8.8X%8.8X/%X",
name, name,
ACPI_FORMAT_UINT64(address64-> ACPI_FORMAT_UINT64(address64->
address), address),
...@@ -512,12 +515,14 @@ static void acpi_tb_validate_fadt(void) ...@@ -512,12 +515,14 @@ static void acpi_tb_validate_fadt(void)
} else if (fadt_info_table[i].type & ACPI_FADT_SEPARATE_LENGTH) { } else if (fadt_info_table[i].type & ACPI_FADT_SEPARATE_LENGTH) {
/* /*
* Field is optional (PM2Control, GPE0, GPE1) AND has its own * Field is optional (PM2Control, GPE0, GPE1) AND has its own
* length field. If present, both the address and length must be valid. * length field. If present, both the address and length must
* be valid.
*/ */
if ((address64->address && !length) if ((address64->address && !length) ||
|| (!address64->address && length)) { (!address64->address && length)) {
ACPI_WARNING((AE_INFO, ACPI_WARNING((AE_INFO,
"Optional field %s has zero address or length: %8.8X%8.8X/%X", "Optional field %s has zero address or length: "
"%8.8X%8.8X/%X",
name, name,
ACPI_FORMAT_UINT64(address64-> ACPI_FORMAT_UINT64(address64->
address), address),
...@@ -525,8 +530,10 @@ static void acpi_tb_validate_fadt(void) ...@@ -525,8 +530,10 @@ static void acpi_tb_validate_fadt(void)
} }
} }
/* If both 32- and 64-bit addresses are valid (non-zero), they must match */ /*
* If both 32- and 64-bit addresses are valid (non-zero),
* they must match
*/
if (address64->address && *address32 && if (address64->address && *address32 &&
(address64->address != (u64) * address32)) { (address64->address != (u64) * address32)) {
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
...@@ -537,7 +544,7 @@ static void acpi_tb_validate_fadt(void) ...@@ -537,7 +544,7 @@ static void acpi_tb_validate_fadt(void)
} }
} }
/****************************************************************************** /*******************************************************************************
* *
* FUNCTION: acpi_tb_setup_fadt_registers * FUNCTION: acpi_tb_setup_fadt_registers
* *
...@@ -596,8 +603,8 @@ static void acpi_tb_setup_fadt_registers(void) ...@@ -596,8 +603,8 @@ static void acpi_tb_setup_fadt_registers(void)
* Each register is defined to be (event block length / 2). Extra divide * Each register is defined to be (event block length / 2). Extra divide
* by 8 converts bits to bytes. * by 8 converts bits to bytes.
*/ */
pm1_register_byte_width = pm1_register_byte_width = (u8)
(u8)ACPI_DIV_16(acpi_gbl_FADT.xpm1a_event_block.bit_width); ACPI_DIV_16(acpi_gbl_FADT.xpm1a_event_block.bit_width);
/* /*
* Calculate separate GAS structs for the PM1x (A/B) Status and Enable * Calculate separate GAS structs for the PM1x (A/B) Status and Enable
......
...@@ -273,8 +273,9 @@ acpi_status acpi_tb_resize_root_table_list(void) ...@@ -273,8 +273,9 @@ acpi_status acpi_tb_resize_root_table_list(void)
/* Increase the Table Array size */ /* Increase the Table Array size */
tables = ACPI_ALLOCATE_ZEROED(((acpi_size) acpi_gbl_root_table_list. tables = ACPI_ALLOCATE_ZEROED(((acpi_size) acpi_gbl_root_table_list.
size + ACPI_ROOT_TABLE_SIZE_INCREMENT) size +
* sizeof(struct acpi_table_desc)); ACPI_ROOT_TABLE_SIZE_INCREMENT) *
sizeof(struct acpi_table_desc));
if (!tables) { if (!tables) {
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Could not allocate new root table array")); "Could not allocate new root table array"));
...@@ -561,8 +562,8 @@ u8 acpi_tb_is_table_loaded(u32 table_index) ...@@ -561,8 +562,8 @@ u8 acpi_tb_is_table_loaded(u32 table_index)
(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
if (table_index < acpi_gbl_root_table_list.count) { if (table_index < acpi_gbl_root_table_list.count) {
is_loaded = (u8) is_loaded = (u8)
(acpi_gbl_root_table_list.tables[table_index]. (acpi_gbl_root_table_list.tables[table_index].flags &
flags & ACPI_TABLE_IS_LOADED); ACPI_TABLE_IS_LOADED);
} }
(void)acpi_ut_release_mutex(ACPI_MTX_TABLES); (void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
......
...@@ -413,7 +413,8 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size) ...@@ -413,7 +413,8 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size)
} else { } else {
/* /*
* 32-bit platform, XSDT: Truncate 64-bit to 32-bit and return * 32-bit platform, XSDT: Truncate 64-bit to 32-bit and return
* 64-bit platform, XSDT: Move (unaligned) 64-bit to local, return 64-bit * 64-bit platform, XSDT: Move (unaligned) 64-bit to local,
* return 64-bit
*/ */
ACPI_MOVE_64_TO_64(&address64, table_entry); ACPI_MOVE_64_TO_64(&address64, table_entry);
...@@ -423,7 +424,8 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size) ...@@ -423,7 +424,8 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size)
/* Will truncate 64-bit address to 32 bits, issue warning */ /* Will truncate 64-bit address to 32 bits, issue warning */
ACPI_WARNING((AE_INFO, ACPI_WARNING((AE_INFO,
"64-bit Physical Address in XSDT is too large (%8.8X%8.8X), truncating", "64-bit Physical Address in XSDT is too large (%8.8X%8.8X),"
" truncating",
ACPI_FORMAT_UINT64(address64))); ACPI_FORMAT_UINT64(address64)));
} }
#endif #endif
...@@ -546,13 +548,12 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address) ...@@ -546,13 +548,12 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
/* Calculate the number of tables described in the root table */ /* Calculate the number of tables described in the root table */
table_count = table_count = (u32)((table->length - sizeof(struct acpi_table_header)) /
(u32) ((table->length - table_entry_size);
sizeof(struct acpi_table_header)) / table_entry_size);
/* /*
* First two entries in the table array are reserved for the DSDT and FACS, * First two entries in the table array are reserved for the DSDT
* which are not actually present in the RSDT/XSDT - they come from the FADT * and FACS, which are not actually present in the RSDT/XSDT - they
* come from the FADT
*/ */
table_entry = table_entry =
ACPI_CAST_PTR(u8, table) + sizeof(struct acpi_table_header); ACPI_CAST_PTR(u8, table) + sizeof(struct acpi_table_header);
......
...@@ -246,7 +246,7 @@ acpi_status acpi_load_table(struct acpi_table_header *table_ptr) ...@@ -246,7 +246,7 @@ acpi_status acpi_load_table(struct acpi_table_header *table_ptr)
ACPI_EXPORT_SYMBOL(acpi_load_table) ACPI_EXPORT_SYMBOL(acpi_load_table)
/****************************************************************************** /*******************************************************************************
* *
* FUNCTION: acpi_get_table_header * FUNCTION: acpi_get_table_header
* *
...@@ -261,7 +261,7 @@ ACPI_EXPORT_SYMBOL(acpi_load_table) ...@@ -261,7 +261,7 @@ ACPI_EXPORT_SYMBOL(acpi_load_table)
* NOTE: Caller is responsible in unmapping the header with * NOTE: Caller is responsible in unmapping the header with
* acpi_os_unmap_memory * acpi_os_unmap_memory
* *
*****************************************************************************/ ******************************************************************************/
acpi_status acpi_status
acpi_get_table_header(char *signature, acpi_get_table_header(char *signature,
u32 instance, struct acpi_table_header *out_table_header) u32 instance, struct acpi_table_header *out_table_header)
...@@ -276,9 +276,8 @@ acpi_get_table_header(char *signature, ...@@ -276,9 +276,8 @@ acpi_get_table_header(char *signature,
return (AE_BAD_PARAMETER); return (AE_BAD_PARAMETER);
} }
/* /* Walk the root table list */
* Walk the root table list
*/
for (i = 0, j = 0; i < acpi_gbl_root_table_list.count; i++) { for (i = 0, j = 0; i < acpi_gbl_root_table_list.count; i++) {
if (!ACPI_COMPARE_NAME if (!ACPI_COMPARE_NAME
(&(acpi_gbl_root_table_list.tables[i].signature), (&(acpi_gbl_root_table_list.tables[i].signature),
...@@ -291,8 +290,8 @@ acpi_get_table_header(char *signature, ...@@ -291,8 +290,8 @@ acpi_get_table_header(char *signature,
} }
if (!acpi_gbl_root_table_list.tables[i].pointer) { if (!acpi_gbl_root_table_list.tables[i].pointer) {
if ((acpi_gbl_root_table_list.tables[i]. if ((acpi_gbl_root_table_list.tables[i].flags &
flags & ACPI_TABLE_ORIGIN_MASK) == ACPI_TABLE_ORIGIN_MASK) ==
ACPI_TABLE_ORIGIN_MAPPED) { ACPI_TABLE_ORIGIN_MAPPED) {
header = header =
acpi_os_map_memory(acpi_gbl_root_table_list. acpi_os_map_memory(acpi_gbl_root_table_list.
...@@ -323,7 +322,7 @@ acpi_get_table_header(char *signature, ...@@ -323,7 +322,7 @@ acpi_get_table_header(char *signature,
ACPI_EXPORT_SYMBOL(acpi_get_table_header) ACPI_EXPORT_SYMBOL(acpi_get_table_header)
/****************************************************************************** /*******************************************************************************
* *
* FUNCTION: acpi_unload_table_id * FUNCTION: acpi_unload_table_id
* *
...@@ -374,7 +373,7 @@ ACPI_EXPORT_SYMBOL(acpi_unload_table_id) ...@@ -374,7 +373,7 @@ ACPI_EXPORT_SYMBOL(acpi_unload_table_id)
* *
* DESCRIPTION: Finds and verifies an ACPI table. * DESCRIPTION: Finds and verifies an ACPI table.
* *
*****************************************************************************/ ******************************************************************************/
acpi_status acpi_status
acpi_get_table(char *signature, acpi_get_table(char *signature,
u32 instance, struct acpi_table_header **out_table) u32 instance, struct acpi_table_header **out_table)
...@@ -389,9 +388,8 @@ acpi_get_table(char *signature, ...@@ -389,9 +388,8 @@ acpi_get_table(char *signature,
return (AE_BAD_PARAMETER); return (AE_BAD_PARAMETER);
} }
/* /* Walk the root table list */
* Walk the root table list
*/
for (i = 0, j = 0; i < acpi_gbl_root_table_list.count; i++) { for (i = 0, j = 0; i < acpi_gbl_root_table_list.count; i++) {
if (!ACPI_COMPARE_NAME if (!ACPI_COMPARE_NAME
(&(acpi_gbl_root_table_list.tables[i].signature), (&(acpi_gbl_root_table_list.tables[i].signature),
...@@ -526,17 +524,15 @@ static acpi_status acpi_tb_load_namespace(void) ...@@ -526,17 +524,15 @@ static acpi_status acpi_tb_load_namespace(void)
(void)acpi_ut_release_mutex(ACPI_MTX_TABLES); (void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
/* /* Load and parse tables */
* Load and parse tables.
*/
status = acpi_ns_load_table(ACPI_TABLE_INDEX_DSDT, acpi_gbl_root_node); status = acpi_ns_load_table(ACPI_TABLE_INDEX_DSDT, acpi_gbl_root_node);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
/* /* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */
* Load any SSDT or PSDT tables. Note: Loop leaves tables locked
*/
(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
for (i = 0; i < acpi_gbl_root_table_list.count; ++i) { for (i = 0; i < acpi_gbl_root_table_list.count; ++i) {
if ((!ACPI_COMPARE_NAME if ((!ACPI_COMPARE_NAME
...@@ -589,9 +585,8 @@ acpi_status acpi_load_tables(void) ...@@ -589,9 +585,8 @@ acpi_status acpi_load_tables(void)
ACPI_FUNCTION_TRACE(acpi_load_tables); ACPI_FUNCTION_TRACE(acpi_load_tables);
/* /* Load the namespace from the tables */
* Load the namespace from the tables
*/
status = acpi_tb_load_namespace(); status = acpi_tb_load_namespace();
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, ACPI_EXCEPTION((AE_INFO, status,
......
...@@ -75,8 +75,8 @@ static acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp) ...@@ -75,8 +75,8 @@ static acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp)
* Note: Sometimes there exists more than one RSDP in memory; the valid * Note: Sometimes there exists more than one RSDP in memory; the valid
* RSDP has a valid checksum, all others have an invalid checksum. * RSDP has a valid checksum, all others have an invalid checksum.
*/ */
if (ACPI_STRNCMP((char *)rsdp, ACPI_SIG_RSDP, sizeof(ACPI_SIG_RSDP) - 1) if (ACPI_STRNCMP((char *)rsdp, ACPI_SIG_RSDP,
!= 0) { sizeof(ACPI_SIG_RSDP) - 1) != 0) {
/* Nope, BAD Signature */ /* Nope, BAD Signature */
......
...@@ -496,8 +496,9 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object, ...@@ -496,8 +496,9 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object,
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
internal_object->string.pointer = internal_object->string.pointer =
ACPI_ALLOCATE_ZEROED((acpi_size) external_object->string. ACPI_ALLOCATE_ZEROED((acpi_size)
length + 1); external_object->string.length + 1);
if (!internal_object->string.pointer) { if (!internal_object->string.pointer) {
goto error_exit; goto error_exit;
} }
......
...@@ -124,9 +124,8 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state) ...@@ -124,9 +124,8 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state)
/* Compare input string to static table of supported interfaces */ /* Compare input string to static table of supported interfaces */
for (i = 0; i < ACPI_ARRAY_LENGTH(acpi_interfaces_supported); i++) { for (i = 0; i < ACPI_ARRAY_LENGTH(acpi_interfaces_supported); i++) {
if (!ACPI_STRCMP if (!ACPI_STRCMP(string_desc->string.pointer,
(string_desc->string.pointer, acpi_interfaces_supported[i])) {
acpi_interfaces_supported[i])) {
/* The interface is supported */ /* The interface is supported */
......
...@@ -746,7 +746,10 @@ acpi_status acpi_ut_init_globals(void) ...@@ -746,7 +746,10 @@ acpi_status acpi_ut_init_globals(void)
for (i = 0; i < ACPI_NUM_OWNERID_MASKS; i++) { for (i = 0; i < ACPI_NUM_OWNERID_MASKS; i++) {
acpi_gbl_owner_id_mask[i] = 0; acpi_gbl_owner_id_mask[i] = 0;
} }
acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000; /* Last ID is never valid */
/* Last owner_iD is never valid */
acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000;
/* GPE support */ /* GPE support */
......
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