aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/acpica/tbfadt.c33
-rw-r--r--drivers/acpi/acpica/tbinstal.c9
-rw-r--r--drivers/acpi/acpica/tbutils.c17
-rw-r--r--drivers/acpi/acpica/tbxface.c37
-rw-r--r--drivers/acpi/acpica/tbxfroot.c4
-rw-r--r--drivers/acpi/acpica/utcopy.c5
-rw-r--r--drivers/acpi/acpica/uteval.c5
-rw-r--r--drivers/acpi/acpica/utglobal.c5
8 files changed, 61 insertions, 54 deletions
diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c
index 43fe886b41a2..af8fbe12d8b7 100644
--- a/drivers/acpi/acpica/tbfadt.c
+++ b/drivers/acpi/acpica/tbfadt.c
@@ -132,7 +132,8 @@ static struct acpi_fadt_info fadt_info_table[] = {
132 ACPI_FADT_SEPARATE_LENGTH} 132 ACPI_FADT_SEPARATE_LENGTH}
133}; 133};
134 134
135#define ACPI_FADT_INFO_ENTRIES (sizeof (fadt_info_table) / sizeof (struct acpi_fadt_info)) 135#define ACPI_FADT_INFO_ENTRIES \
136 (sizeof (fadt_info_table) / sizeof (struct acpi_fadt_info))
136 137
137/* Table used to split Event Blocks into separate status/enable registers */ 138/* Table used to split Event Blocks into separate status/enable registers */
138 139
@@ -161,7 +162,8 @@ static struct acpi_fadt_pm_info fadt_pm_info_table[] = {
161 1} 162 1}
162}; 163};
163 164
164#define ACPI_FADT_PM_INFO_ENTRIES (sizeof (fadt_pm_info_table) / sizeof (struct acpi_fadt_pm_info)) 165#define ACPI_FADT_PM_INFO_ENTRIES \
166 (sizeof (fadt_pm_info_table) / sizeof (struct acpi_fadt_pm_info))
165 167
166/******************************************************************************* 168/*******************************************************************************
167 * 169 *
@@ -416,7 +418,7 @@ static void acpi_tb_convert_fadt(void)
416 } 418 }
417} 419}
418 420
419/****************************************************************************** 421/*******************************************************************************
420 * 422 *
421 * FUNCTION: acpi_tb_validate_fadt 423 * FUNCTION: acpi_tb_validate_fadt
422 * 424 *
@@ -503,7 +505,8 @@ static void acpi_tb_validate_fadt(void)
503 */ 505 */
504 if (!address64->address || !length) { 506 if (!address64->address || !length) {
505 ACPI_ERROR((AE_INFO, 507 ACPI_ERROR((AE_INFO,
506 "Required field %s has zero address and/or length: %8.8X%8.8X/%X", 508 "Required field %s has zero address and/or length:"
509 " %8.8X%8.8X/%X",
507 name, 510 name,
508 ACPI_FORMAT_UINT64(address64-> 511 ACPI_FORMAT_UINT64(address64->
509 address), 512 address),
@@ -512,12 +515,14 @@ static void acpi_tb_validate_fadt(void)
512 } else if (fadt_info_table[i].type & ACPI_FADT_SEPARATE_LENGTH) { 515 } else if (fadt_info_table[i].type & ACPI_FADT_SEPARATE_LENGTH) {
513 /* 516 /*
514 * Field is optional (PM2Control, GPE0, GPE1) AND has its own 517 * Field is optional (PM2Control, GPE0, GPE1) AND has its own
515 * length field. If present, both the address and length must be valid. 518 * length field. If present, both the address and length must
519 * be valid.
516 */ 520 */
517 if ((address64->address && !length) 521 if ((address64->address && !length) ||
518 || (!address64->address && length)) { 522 (!address64->address && length)) {
519 ACPI_WARNING((AE_INFO, 523 ACPI_WARNING((AE_INFO,
520 "Optional field %s has zero address or length: %8.8X%8.8X/%X", 524 "Optional field %s has zero address or length: "
525 "%8.8X%8.8X/%X",
521 name, 526 name,
522 ACPI_FORMAT_UINT64(address64-> 527 ACPI_FORMAT_UINT64(address64->
523 address), 528 address),
@@ -525,8 +530,10 @@ static void acpi_tb_validate_fadt(void)
525 } 530 }
526 } 531 }
527 532
528 /* If both 32- and 64-bit addresses are valid (non-zero), they must match */ 533 /*
529 534 * If both 32- and 64-bit addresses are valid (non-zero),
535 * they must match
536 */
530 if (address64->address && *address32 && 537 if (address64->address && *address32 &&
531 (address64->address != (u64) * address32)) { 538 (address64->address != (u64) * address32)) {
532 ACPI_ERROR((AE_INFO, 539 ACPI_ERROR((AE_INFO,
@@ -537,7 +544,7 @@ static void acpi_tb_validate_fadt(void)
537 } 544 }
538} 545}
539 546
540/****************************************************************************** 547/*******************************************************************************
541 * 548 *
542 * FUNCTION: acpi_tb_setup_fadt_registers 549 * FUNCTION: acpi_tb_setup_fadt_registers
543 * 550 *
@@ -596,8 +603,8 @@ static void acpi_tb_setup_fadt_registers(void)
596 * Each register is defined to be (event block length / 2). Extra divide 603 * Each register is defined to be (event block length / 2). Extra divide
597 * by 8 converts bits to bytes. 604 * by 8 converts bits to bytes.
598 */ 605 */
599 pm1_register_byte_width = 606 pm1_register_byte_width = (u8)
600 (u8)ACPI_DIV_16(acpi_gbl_FADT.xpm1a_event_block.bit_width); 607 ACPI_DIV_16(acpi_gbl_FADT.xpm1a_event_block.bit_width);
601 608
602 /* 609 /*
603 * Calculate separate GAS structs for the PM1x (A/B) Status and Enable 610 * Calculate separate GAS structs for the PM1x (A/B) Status and Enable
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c
index ef269a297b57..c37993003f2c 100644
--- a/drivers/acpi/acpica/tbinstal.c
+++ b/drivers/acpi/acpica/tbinstal.c
@@ -273,8 +273,9 @@ acpi_status acpi_tb_resize_root_table_list(void)
273 /* Increase the Table Array size */ 273 /* Increase the Table Array size */
274 274
275 tables = ACPI_ALLOCATE_ZEROED(((acpi_size) acpi_gbl_root_table_list. 275 tables = ACPI_ALLOCATE_ZEROED(((acpi_size) acpi_gbl_root_table_list.
276 size + ACPI_ROOT_TABLE_SIZE_INCREMENT) 276 size +
277 * sizeof(struct acpi_table_desc)); 277 ACPI_ROOT_TABLE_SIZE_INCREMENT) *
278 sizeof(struct acpi_table_desc));
278 if (!tables) { 279 if (!tables) {
279 ACPI_ERROR((AE_INFO, 280 ACPI_ERROR((AE_INFO,
280 "Could not allocate new root table array")); 281 "Could not allocate new root table array"));
@@ -561,8 +562,8 @@ u8 acpi_tb_is_table_loaded(u32 table_index)
561 (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); 562 (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
562 if (table_index < acpi_gbl_root_table_list.count) { 563 if (table_index < acpi_gbl_root_table_list.count) {
563 is_loaded = (u8) 564 is_loaded = (u8)
564 (acpi_gbl_root_table_list.tables[table_index]. 565 (acpi_gbl_root_table_list.tables[table_index].flags &
565 flags & ACPI_TABLE_IS_LOADED); 566 ACPI_TABLE_IS_LOADED);
566 } 567 }
567 568
568 (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); 569 (void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
index a0b424356b98..dc45b49e5cb9 100644
--- a/drivers/acpi/acpica/tbutils.c
+++ b/drivers/acpi/acpica/tbutils.c
@@ -413,7 +413,8 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size)
413 } else { 413 } else {
414 /* 414 /*
415 * 32-bit platform, XSDT: Truncate 64-bit to 32-bit and return 415 * 32-bit platform, XSDT: Truncate 64-bit to 32-bit and return
416 * 64-bit platform, XSDT: Move (unaligned) 64-bit to local, return 64-bit 416 * 64-bit platform, XSDT: Move (unaligned) 64-bit to local,
417 * return 64-bit
417 */ 418 */
418 ACPI_MOVE_64_TO_64(&address64, table_entry); 419 ACPI_MOVE_64_TO_64(&address64, table_entry);
419 420
@@ -423,7 +424,8 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size)
423 /* Will truncate 64-bit address to 32 bits, issue warning */ 424 /* Will truncate 64-bit address to 32 bits, issue warning */
424 425
425 ACPI_WARNING((AE_INFO, 426 ACPI_WARNING((AE_INFO,
426 "64-bit Physical Address in XSDT is too large (%8.8X%8.8X), truncating", 427 "64-bit Physical Address in XSDT is too large (%8.8X%8.8X),"
428 " truncating",
427 ACPI_FORMAT_UINT64(address64))); 429 ACPI_FORMAT_UINT64(address64)));
428 } 430 }
429#endif 431#endif
@@ -546,13 +548,12 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
546 548
547 /* Calculate the number of tables described in the root table */ 549 /* Calculate the number of tables described in the root table */
548 550
549 table_count = 551 table_count = (u32)((table->length - sizeof(struct acpi_table_header)) /
550 (u32) ((table->length - 552 table_entry_size);
551 sizeof(struct acpi_table_header)) / table_entry_size);
552
553 /* 553 /*
554 * First two entries in the table array are reserved for the DSDT and FACS, 554 * First two entries in the table array are reserved for the DSDT
555 * which are not actually present in the RSDT/XSDT - they come from the FADT 555 * and FACS, which are not actually present in the RSDT/XSDT - they
556 * come from the FADT
556 */ 557 */
557 table_entry = 558 table_entry =
558 ACPI_CAST_PTR(u8, table) + sizeof(struct acpi_table_header); 559 ACPI_CAST_PTR(u8, table) + sizeof(struct acpi_table_header);
diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c
index 416d01d9a970..dbca22651504 100644
--- a/drivers/acpi/acpica/tbxface.c
+++ b/drivers/acpi/acpica/tbxface.c
@@ -246,7 +246,7 @@ acpi_status acpi_load_table(struct acpi_table_header *table_ptr)
246 246
247ACPI_EXPORT_SYMBOL(acpi_load_table) 247ACPI_EXPORT_SYMBOL(acpi_load_table)
248 248
249/****************************************************************************** 249/*******************************************************************************
250 * 250 *
251 * FUNCTION: acpi_get_table_header 251 * FUNCTION: acpi_get_table_header
252 * 252 *
@@ -261,7 +261,7 @@ ACPI_EXPORT_SYMBOL(acpi_load_table)
261 * NOTE: Caller is responsible in unmapping the header with 261 * NOTE: Caller is responsible in unmapping the header with
262 * acpi_os_unmap_memory 262 * acpi_os_unmap_memory
263 * 263 *
264 *****************************************************************************/ 264 ******************************************************************************/
265acpi_status 265acpi_status
266acpi_get_table_header(char *signature, 266acpi_get_table_header(char *signature,
267 u32 instance, struct acpi_table_header *out_table_header) 267 u32 instance, struct acpi_table_header *out_table_header)
@@ -276,9 +276,8 @@ acpi_get_table_header(char *signature,
276 return (AE_BAD_PARAMETER); 276 return (AE_BAD_PARAMETER);
277 } 277 }
278 278
279 /* 279 /* Walk the root table list */
280 * Walk the root table list 280
281 */
282 for (i = 0, j = 0; i < acpi_gbl_root_table_list.count; i++) { 281 for (i = 0, j = 0; i < acpi_gbl_root_table_list.count; i++) {
283 if (!ACPI_COMPARE_NAME 282 if (!ACPI_COMPARE_NAME
284 (&(acpi_gbl_root_table_list.tables[i].signature), 283 (&(acpi_gbl_root_table_list.tables[i].signature),
@@ -291,8 +290,8 @@ acpi_get_table_header(char *signature,
291 } 290 }
292 291
293 if (!acpi_gbl_root_table_list.tables[i].pointer) { 292 if (!acpi_gbl_root_table_list.tables[i].pointer) {
294 if ((acpi_gbl_root_table_list.tables[i]. 293 if ((acpi_gbl_root_table_list.tables[i].flags &
295 flags & ACPI_TABLE_ORIGIN_MASK) == 294 ACPI_TABLE_ORIGIN_MASK) ==
296 ACPI_TABLE_ORIGIN_MAPPED) { 295 ACPI_TABLE_ORIGIN_MAPPED) {
297 header = 296 header =
298 acpi_os_map_memory(acpi_gbl_root_table_list. 297 acpi_os_map_memory(acpi_gbl_root_table_list.
@@ -323,7 +322,7 @@ acpi_get_table_header(char *signature,
323 322
324ACPI_EXPORT_SYMBOL(acpi_get_table_header) 323ACPI_EXPORT_SYMBOL(acpi_get_table_header)
325 324
326/****************************************************************************** 325/*******************************************************************************
327 * 326 *
328 * FUNCTION: acpi_unload_table_id 327 * FUNCTION: acpi_unload_table_id
329 * 328 *
@@ -374,7 +373,7 @@ ACPI_EXPORT_SYMBOL(acpi_unload_table_id)
374 * 373 *
375 * DESCRIPTION: Finds and verifies an ACPI table. 374 * DESCRIPTION: Finds and verifies an ACPI table.
376 * 375 *
377 *****************************************************************************/ 376 ******************************************************************************/
378acpi_status 377acpi_status
379acpi_get_table(char *signature, 378acpi_get_table(char *signature,
380 u32 instance, struct acpi_table_header **out_table) 379 u32 instance, struct acpi_table_header **out_table)
@@ -389,9 +388,8 @@ acpi_get_table(char *signature,
389 return (AE_BAD_PARAMETER); 388 return (AE_BAD_PARAMETER);
390 } 389 }
391 390
392 /* 391 /* Walk the root table list */
393 * Walk the root table list 392
394 */
395 for (i = 0, j = 0; i < acpi_gbl_root_table_list.count; i++) { 393 for (i = 0, j = 0; i < acpi_gbl_root_table_list.count; i++) {
396 if (!ACPI_COMPARE_NAME 394 if (!ACPI_COMPARE_NAME
397 (&(acpi_gbl_root_table_list.tables[i].signature), 395 (&(acpi_gbl_root_table_list.tables[i].signature),
@@ -526,17 +524,15 @@ static acpi_status acpi_tb_load_namespace(void)
526 524
527 (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); 525 (void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
528 526
529 /* 527 /* Load and parse tables */
530 * Load and parse tables. 528
531 */
532 status = acpi_ns_load_table(ACPI_TABLE_INDEX_DSDT, acpi_gbl_root_node); 529 status = acpi_ns_load_table(ACPI_TABLE_INDEX_DSDT, acpi_gbl_root_node);
533 if (ACPI_FAILURE(status)) { 530 if (ACPI_FAILURE(status)) {
534 return_ACPI_STATUS(status); 531 return_ACPI_STATUS(status);
535 } 532 }
536 533
537 /* 534 /* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */
538 * Load any SSDT or PSDT tables. Note: Loop leaves tables locked 535
539 */
540 (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); 536 (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
541 for (i = 0; i < acpi_gbl_root_table_list.count; ++i) { 537 for (i = 0; i < acpi_gbl_root_table_list.count; ++i) {
542 if ((!ACPI_COMPARE_NAME 538 if ((!ACPI_COMPARE_NAME
@@ -589,9 +585,8 @@ acpi_status acpi_load_tables(void)
589 585
590 ACPI_FUNCTION_TRACE(acpi_load_tables); 586 ACPI_FUNCTION_TRACE(acpi_load_tables);
591 587
592 /* 588 /* Load the namespace from the tables */
593 * Load the namespace from the tables 589
594 */
595 status = acpi_tb_load_namespace(); 590 status = acpi_tb_load_namespace();
596 if (ACPI_FAILURE(status)) { 591 if (ACPI_FAILURE(status)) {
597 ACPI_EXCEPTION((AE_INFO, status, 592 ACPI_EXCEPTION((AE_INFO, status,
diff --git a/drivers/acpi/acpica/tbxfroot.c b/drivers/acpi/acpica/tbxfroot.c
index b7fc8dd43341..85ea834199e2 100644
--- a/drivers/acpi/acpica/tbxfroot.c
+++ b/drivers/acpi/acpica/tbxfroot.c
@@ -75,8 +75,8 @@ static acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp)
75 * Note: Sometimes there exists more than one RSDP in memory; the valid 75 * Note: Sometimes there exists more than one RSDP in memory; the valid
76 * RSDP has a valid checksum, all others have an invalid checksum. 76 * RSDP has a valid checksum, all others have an invalid checksum.
77 */ 77 */
78 if (ACPI_STRNCMP((char *)rsdp, ACPI_SIG_RSDP, sizeof(ACPI_SIG_RSDP) - 1) 78 if (ACPI_STRNCMP((char *)rsdp, ACPI_SIG_RSDP,
79 != 0) { 79 sizeof(ACPI_SIG_RSDP) - 1) != 0) {
80 80
81 /* Nope, BAD Signature */ 81 /* Nope, BAD Signature */
82 82
diff --git a/drivers/acpi/acpica/utcopy.c b/drivers/acpi/acpica/utcopy.c
index cabe860ce007..919624f123d5 100644
--- a/drivers/acpi/acpica/utcopy.c
+++ b/drivers/acpi/acpica/utcopy.c
@@ -496,8 +496,9 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object,
496 case ACPI_TYPE_STRING: 496 case ACPI_TYPE_STRING:
497 497
498 internal_object->string.pointer = 498 internal_object->string.pointer =
499 ACPI_ALLOCATE_ZEROED((acpi_size) external_object->string. 499 ACPI_ALLOCATE_ZEROED((acpi_size)
500 length + 1); 500 external_object->string.length + 1);
501
501 if (!internal_object->string.pointer) { 502 if (!internal_object->string.pointer) {
502 goto error_exit; 503 goto error_exit;
503 } 504 }
diff --git a/drivers/acpi/acpica/uteval.c b/drivers/acpi/acpica/uteval.c
index 9c4ae6f26b9d..3b9152579d04 100644
--- a/drivers/acpi/acpica/uteval.c
+++ b/drivers/acpi/acpica/uteval.c
@@ -124,9 +124,8 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state)
124 /* Compare input string to static table of supported interfaces */ 124 /* Compare input string to static table of supported interfaces */
125 125
126 for (i = 0; i < ACPI_ARRAY_LENGTH(acpi_interfaces_supported); i++) { 126 for (i = 0; i < ACPI_ARRAY_LENGTH(acpi_interfaces_supported); i++) {
127 if (!ACPI_STRCMP 127 if (!ACPI_STRCMP(string_desc->string.pointer,
128 (string_desc->string.pointer, 128 acpi_interfaces_supported[i])) {
129 acpi_interfaces_supported[i])) {
130 129
131 /* The interface is supported */ 130 /* The interface is supported */
132 131
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index 7fc35d33adb1..256ce7778565 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -746,7 +746,10 @@ acpi_status acpi_ut_init_globals(void)
746 for (i = 0; i < ACPI_NUM_OWNERID_MASKS; i++) { 746 for (i = 0; i < ACPI_NUM_OWNERID_MASKS; i++) {
747 acpi_gbl_owner_id_mask[i] = 0; 747 acpi_gbl_owner_id_mask[i] = 0;
748 } 748 }
749 acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000; /* Last ID is never valid */ 749
750 /* Last owner_iD is never valid */
751
752 acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000;
750 753
751 /* GPE support */ 754 /* GPE support */
752 755