aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/utilities')
-rw-r--r--drivers/acpi/utilities/utalloc.c5
-rw-r--r--drivers/acpi/utilities/utcopy.c4
-rw-r--r--drivers/acpi/utilities/utdebug.c54
-rw-r--r--drivers/acpi/utilities/utdelete.c2
-rw-r--r--drivers/acpi/utilities/uteval.c5
-rw-r--r--drivers/acpi/utilities/utmisc.c39
-rw-r--r--drivers/acpi/utilities/utmutex.c4
-rw-r--r--drivers/acpi/utilities/utobject.c9
8 files changed, 66 insertions, 56 deletions
diff --git a/drivers/acpi/utilities/utalloc.c b/drivers/acpi/utilities/utalloc.c
index ede084829a70..3dfb8a442b26 100644
--- a/drivers/acpi/utilities/utalloc.c
+++ b/drivers/acpi/utilities/utalloc.c
@@ -309,7 +309,8 @@ acpi_ut_initialize_buffer(struct acpi_buffer * buffer,
309 * 309 *
310 ******************************************************************************/ 310 ******************************************************************************/
311 311
312void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line) 312void *acpi_ut_allocate(acpi_size size,
313 u32 component, const char *module, u32 line)
313{ 314{
314 void *allocation; 315 void *allocation;
315 316
@@ -353,7 +354,7 @@ void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line)
353 ******************************************************************************/ 354 ******************************************************************************/
354 355
355void *acpi_ut_allocate_zeroed(acpi_size size, 356void *acpi_ut_allocate_zeroed(acpi_size size,
356 u32 component, char *module, u32 line) 357 u32 component, const char *module, u32 line)
357{ 358{
358 void *allocation; 359 void *allocation;
359 360
diff --git a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c
index 655c290aca7b..53499ac90988 100644
--- a/drivers/acpi/utilities/utcopy.c
+++ b/drivers/acpi/utilities/utcopy.c
@@ -572,7 +572,7 @@ acpi_ut_copy_epackage_to_ipackage(union acpi_object *external_object,
572 acpi_status status = AE_OK; 572 acpi_status status = AE_OK;
573 union acpi_operand_object *package_object; 573 union acpi_operand_object *package_object;
574 union acpi_operand_object **package_elements; 574 union acpi_operand_object **package_elements;
575 acpi_native_uint i; 575 u32 i;
576 576
577 ACPI_FUNCTION_TRACE(ut_copy_epackage_to_ipackage); 577 ACPI_FUNCTION_TRACE(ut_copy_epackage_to_ipackage);
578 578
@@ -599,7 +599,7 @@ acpi_ut_copy_epackage_to_ipackage(union acpi_object *external_object,
599 599
600 /* Truncate package and delete it */ 600 /* Truncate package and delete it */
601 601
602 package_object->package.count = (u32) i; 602 package_object->package.count = i;
603 package_elements[i] = NULL; 603 package_elements[i] = NULL;
604 acpi_ut_remove_reference(package_object); 604 acpi_ut_remove_reference(package_object);
605 return_ACPI_STATUS(status); 605 return_ACPI_STATUS(status);
diff --git a/drivers/acpi/utilities/utdebug.c b/drivers/acpi/utilities/utdebug.c
index f938f465efa4..fd66ecb6741e 100644
--- a/drivers/acpi/utilities/utdebug.c
+++ b/drivers/acpi/utilities/utdebug.c
@@ -157,7 +157,8 @@ void ACPI_INTERNAL_VAR_XFACE
157acpi_ut_debug_print(u32 requested_debug_level, 157acpi_ut_debug_print(u32 requested_debug_level,
158 u32 line_number, 158 u32 line_number,
159 const char *function_name, 159 const char *function_name,
160 char *module_name, u32 component_id, char *format, ...) 160 const char *module_name,
161 u32 component_id, const char *format, ...)
161{ 162{
162 acpi_thread_id thread_id; 163 acpi_thread_id thread_id;
163 va_list args; 164 va_list args;
@@ -228,7 +229,8 @@ void ACPI_INTERNAL_VAR_XFACE
228acpi_ut_debug_print_raw(u32 requested_debug_level, 229acpi_ut_debug_print_raw(u32 requested_debug_level,
229 u32 line_number, 230 u32 line_number,
230 const char *function_name, 231 const char *function_name,
231 char *module_name, u32 component_id, char *format, ...) 232 const char *module_name,
233 u32 component_id, const char *format, ...)
232{ 234{
233 va_list args; 235 va_list args;
234 236
@@ -261,7 +263,8 @@ ACPI_EXPORT_SYMBOL(acpi_ut_debug_print_raw)
261 ******************************************************************************/ 263 ******************************************************************************/
262void 264void
263acpi_ut_trace(u32 line_number, 265acpi_ut_trace(u32 line_number,
264 const char *function_name, char *module_name, u32 component_id) 266 const char *function_name,
267 const char *module_name, u32 component_id)
265{ 268{
266 269
267 acpi_gbl_nesting_level++; 270 acpi_gbl_nesting_level++;
@@ -293,7 +296,7 @@ ACPI_EXPORT_SYMBOL(acpi_ut_trace)
293void 296void
294acpi_ut_trace_ptr(u32 line_number, 297acpi_ut_trace_ptr(u32 line_number,
295 const char *function_name, 298 const char *function_name,
296 char *module_name, u32 component_id, void *pointer) 299 const char *module_name, u32 component_id, void *pointer)
297{ 300{
298 acpi_gbl_nesting_level++; 301 acpi_gbl_nesting_level++;
299 acpi_ut_track_stack_ptr(); 302 acpi_ut_track_stack_ptr();
@@ -324,7 +327,7 @@ acpi_ut_trace_ptr(u32 line_number,
324void 327void
325acpi_ut_trace_str(u32 line_number, 328acpi_ut_trace_str(u32 line_number,
326 const char *function_name, 329 const char *function_name,
327 char *module_name, u32 component_id, char *string) 330 const char *module_name, u32 component_id, char *string)
328{ 331{
329 332
330 acpi_gbl_nesting_level++; 333 acpi_gbl_nesting_level++;
@@ -356,7 +359,7 @@ acpi_ut_trace_str(u32 line_number,
356void 359void
357acpi_ut_trace_u32(u32 line_number, 360acpi_ut_trace_u32(u32 line_number,
358 const char *function_name, 361 const char *function_name,
359 char *module_name, u32 component_id, u32 integer) 362 const char *module_name, u32 component_id, u32 integer)
360{ 363{
361 364
362 acpi_gbl_nesting_level++; 365 acpi_gbl_nesting_level++;
@@ -386,7 +389,8 @@ acpi_ut_trace_u32(u32 line_number,
386 389
387void 390void
388acpi_ut_exit(u32 line_number, 391acpi_ut_exit(u32 line_number,
389 const char *function_name, char *module_name, u32 component_id) 392 const char *function_name,
393 const char *module_name, u32 component_id)
390{ 394{
391 395
392 acpi_ut_debug_print(ACPI_LV_FUNCTIONS, 396 acpi_ut_debug_print(ACPI_LV_FUNCTIONS,
@@ -417,7 +421,8 @@ ACPI_EXPORT_SYMBOL(acpi_ut_exit)
417void 421void
418acpi_ut_status_exit(u32 line_number, 422acpi_ut_status_exit(u32 line_number,
419 const char *function_name, 423 const char *function_name,
420 char *module_name, u32 component_id, acpi_status status) 424 const char *module_name,
425 u32 component_id, acpi_status status)
421{ 426{
422 427
423 if (ACPI_SUCCESS(status)) { 428 if (ACPI_SUCCESS(status)) {
@@ -458,7 +463,8 @@ ACPI_EXPORT_SYMBOL(acpi_ut_status_exit)
458void 463void
459acpi_ut_value_exit(u32 line_number, 464acpi_ut_value_exit(u32 line_number,
460 const char *function_name, 465 const char *function_name,
461 char *module_name, u32 component_id, acpi_integer value) 466 const char *module_name,
467 u32 component_id, acpi_integer value)
462{ 468{
463 469
464 acpi_ut_debug_print(ACPI_LV_FUNCTIONS, 470 acpi_ut_debug_print(ACPI_LV_FUNCTIONS,
@@ -490,7 +496,7 @@ ACPI_EXPORT_SYMBOL(acpi_ut_value_exit)
490void 496void
491acpi_ut_ptr_exit(u32 line_number, 497acpi_ut_ptr_exit(u32 line_number,
492 const char *function_name, 498 const char *function_name,
493 char *module_name, u32 component_id, u8 * ptr) 499 const char *module_name, u32 component_id, u8 *ptr)
494{ 500{
495 501
496 acpi_ut_debug_print(ACPI_LV_FUNCTIONS, 502 acpi_ut_debug_print(ACPI_LV_FUNCTIONS,
@@ -519,8 +525,8 @@ acpi_ut_ptr_exit(u32 line_number,
519 525
520void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display) 526void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display)
521{ 527{
522 acpi_native_uint i = 0; 528 u32 i = 0;
523 acpi_native_uint j; 529 u32 j;
524 u32 temp32; 530 u32 temp32;
525 u8 buf_char; 531 u8 buf_char;
526 532
@@ -539,7 +545,7 @@ void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display)
539 545
540 /* Print current offset */ 546 /* Print current offset */
541 547
542 acpi_os_printf("%6.4X: ", (u32) i); 548 acpi_os_printf("%6.4X: ", i);
543 549
544 /* Print 16 hex chars */ 550 /* Print 16 hex chars */
545 551
@@ -549,7 +555,7 @@ void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display)
549 /* Dump fill spaces */ 555 /* Dump fill spaces */
550 556
551 acpi_os_printf("%*s", ((display * 2) + 1), " "); 557 acpi_os_printf("%*s", ((display * 2) + 1), " ");
552 j += (acpi_native_uint) display; 558 j += display;
553 continue; 559 continue;
554 } 560 }
555 561
@@ -557,32 +563,38 @@ void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display)
557 case DB_BYTE_DISPLAY: 563 case DB_BYTE_DISPLAY:
558 default: /* Default is BYTE display */ 564 default: /* Default is BYTE display */
559 565
560 acpi_os_printf("%02X ", buffer[i + j]); 566 acpi_os_printf("%02X ",
567 buffer[(acpi_size) i + j]);
561 break; 568 break;
562 569
563 case DB_WORD_DISPLAY: 570 case DB_WORD_DISPLAY:
564 571
565 ACPI_MOVE_16_TO_32(&temp32, &buffer[i + j]); 572 ACPI_MOVE_16_TO_32(&temp32,
573 &buffer[(acpi_size) i + j]);
566 acpi_os_printf("%04X ", temp32); 574 acpi_os_printf("%04X ", temp32);
567 break; 575 break;
568 576
569 case DB_DWORD_DISPLAY: 577 case DB_DWORD_DISPLAY:
570 578
571 ACPI_MOVE_32_TO_32(&temp32, &buffer[i + j]); 579 ACPI_MOVE_32_TO_32(&temp32,
580 &buffer[(acpi_size) i + j]);
572 acpi_os_printf("%08X ", temp32); 581 acpi_os_printf("%08X ", temp32);
573 break; 582 break;
574 583
575 case DB_QWORD_DISPLAY: 584 case DB_QWORD_DISPLAY:
576 585
577 ACPI_MOVE_32_TO_32(&temp32, &buffer[i + j]); 586 ACPI_MOVE_32_TO_32(&temp32,
587 &buffer[(acpi_size) i + j]);
578 acpi_os_printf("%08X", temp32); 588 acpi_os_printf("%08X", temp32);
579 589
580 ACPI_MOVE_32_TO_32(&temp32, &buffer[i + j + 4]); 590 ACPI_MOVE_32_TO_32(&temp32,
591 &buffer[(acpi_size) i + j +
592 4]);
581 acpi_os_printf("%08X ", temp32); 593 acpi_os_printf("%08X ", temp32);
582 break; 594 break;
583 } 595 }
584 596
585 j += (acpi_native_uint) display; 597 j += display;
586 } 598 }
587 599
588 /* 600 /*
@@ -596,7 +608,7 @@ void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display)
596 return; 608 return;
597 } 609 }
598 610
599 buf_char = buffer[i + j]; 611 buf_char = buffer[(acpi_size) i + j];
600 if (ACPI_IS_PRINT(buf_char)) { 612 if (ACPI_IS_PRINT(buf_char)) {
601 acpi_os_printf("%c", buf_char); 613 acpi_os_printf("%c", buf_char);
602 } else { 614 } else {
diff --git a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c
index 1fbc35139e84..c5c791a575c9 100644
--- a/drivers/acpi/utilities/utdelete.c
+++ b/drivers/acpi/utilities/utdelete.c
@@ -442,7 +442,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
442 union acpi_generic_state *state_list = NULL; 442 union acpi_generic_state *state_list = NULL;
443 union acpi_operand_object *next_object = NULL; 443 union acpi_operand_object *next_object = NULL;
444 union acpi_generic_state *state; 444 union acpi_generic_state *state;
445 acpi_native_uint i; 445 u32 i;
446 446
447 ACPI_FUNCTION_TRACE_PTR(ut_update_object_reference, object); 447 ACPI_FUNCTION_TRACE_PTR(ut_update_object_reference, object);
448 448
diff --git a/drivers/acpi/utilities/uteval.c b/drivers/acpi/utilities/uteval.c
index 05e61be267d5..352747e49c7a 100644
--- a/drivers/acpi/utilities/uteval.c
+++ b/drivers/acpi/utilities/uteval.c
@@ -97,7 +97,7 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state)
97 acpi_status status; 97 acpi_status status;
98 union acpi_operand_object *string_desc; 98 union acpi_operand_object *string_desc;
99 union acpi_operand_object *return_desc; 99 union acpi_operand_object *return_desc;
100 acpi_native_uint i; 100 u32 i;
101 101
102 ACPI_FUNCTION_TRACE(ut_osi_implementation); 102 ACPI_FUNCTION_TRACE(ut_osi_implementation);
103 103
@@ -217,7 +217,6 @@ acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node,
217 217
218 info->prefix_node = prefix_node; 218 info->prefix_node = prefix_node;
219 info->pathname = path; 219 info->pathname = path;
220 info->parameter_type = ACPI_PARAM_ARGS;
221 220
222 /* Evaluate the object/method */ 221 /* Evaluate the object/method */
223 222
@@ -514,7 +513,7 @@ acpi_ut_execute_CID(struct acpi_namespace_node * device_node,
514 u32 count; 513 u32 count;
515 u32 size; 514 u32 size;
516 struct acpi_compatible_id_list *cid_list; 515 struct acpi_compatible_id_list *cid_list;
517 acpi_native_uint i; 516 u32 i;
518 517
519 ACPI_FUNCTION_TRACE(ut_execute_CID); 518 ACPI_FUNCTION_TRACE(ut_execute_CID);
520 519
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c
index 1f057b71db1a..f34be6773556 100644
--- a/drivers/acpi/utilities/utmisc.c
+++ b/drivers/acpi/utilities/utmisc.c
@@ -64,7 +64,7 @@ ACPI_MODULE_NAME("utmisc")
64 ******************************************************************************/ 64 ******************************************************************************/
65const char *acpi_ut_validate_exception(acpi_status status) 65const char *acpi_ut_validate_exception(acpi_status status)
66{ 66{
67 acpi_status sub_status; 67 u32 sub_status;
68 const char *exception = NULL; 68 const char *exception = NULL;
69 69
70 ACPI_FUNCTION_ENTRY(); 70 ACPI_FUNCTION_ENTRY();
@@ -85,32 +85,28 @@ const char *acpi_ut_validate_exception(acpi_status status)
85 case AE_CODE_PROGRAMMER: 85 case AE_CODE_PROGRAMMER:
86 86
87 if (sub_status <= AE_CODE_PGM_MAX) { 87 if (sub_status <= AE_CODE_PGM_MAX) {
88 exception = 88 exception = acpi_gbl_exception_names_pgm[sub_status];
89 acpi_gbl_exception_names_pgm[sub_status - 1];
90 } 89 }
91 break; 90 break;
92 91
93 case AE_CODE_ACPI_TABLES: 92 case AE_CODE_ACPI_TABLES:
94 93
95 if (sub_status <= AE_CODE_TBL_MAX) { 94 if (sub_status <= AE_CODE_TBL_MAX) {
96 exception = 95 exception = acpi_gbl_exception_names_tbl[sub_status];
97 acpi_gbl_exception_names_tbl[sub_status - 1];
98 } 96 }
99 break; 97 break;
100 98
101 case AE_CODE_AML: 99 case AE_CODE_AML:
102 100
103 if (sub_status <= AE_CODE_AML_MAX) { 101 if (sub_status <= AE_CODE_AML_MAX) {
104 exception = 102 exception = acpi_gbl_exception_names_aml[sub_status];
105 acpi_gbl_exception_names_aml[sub_status - 1];
106 } 103 }
107 break; 104 break;
108 105
109 case AE_CODE_CONTROL: 106 case AE_CODE_CONTROL:
110 107
111 if (sub_status <= AE_CODE_CTRL_MAX) { 108 if (sub_status <= AE_CODE_CTRL_MAX) {
112 exception = 109 exception = acpi_gbl_exception_names_ctrl[sub_status];
113 acpi_gbl_exception_names_ctrl[sub_status - 1];
114 } 110 }
115 break; 111 break;
116 112
@@ -165,9 +161,9 @@ u8 acpi_ut_is_aml_table(struct acpi_table_header *table)
165 161
166acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) 162acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id)
167{ 163{
168 acpi_native_uint i; 164 u32 i;
169 acpi_native_uint j; 165 u32 j;
170 acpi_native_uint k; 166 u32 k;
171 acpi_status status; 167 acpi_status status;
172 168
173 ACPI_FUNCTION_TRACE(ut_allocate_owner_id); 169 ACPI_FUNCTION_TRACE(ut_allocate_owner_id);
@@ -273,7 +269,7 @@ void acpi_ut_release_owner_id(acpi_owner_id * owner_id_ptr)
273{ 269{
274 acpi_owner_id owner_id = *owner_id_ptr; 270 acpi_owner_id owner_id = *owner_id_ptr;
275 acpi_status status; 271 acpi_status status;
276 acpi_native_uint index; 272 u32 index;
277 u32 bit; 273 u32 bit;
278 274
279 ACPI_FUNCTION_TRACE_U32(ut_release_owner_id, owner_id); 275 ACPI_FUNCTION_TRACE_U32(ut_release_owner_id, owner_id);
@@ -593,7 +589,7 @@ acpi_ut_display_init_pathname(u8 type,
593 * 589 *
594 ******************************************************************************/ 590 ******************************************************************************/
595 591
596u8 acpi_ut_valid_acpi_char(char character, acpi_native_uint position) 592u8 acpi_ut_valid_acpi_char(char character, u32 position)
597{ 593{
598 594
599 if (!((character >= 'A' && character <= 'Z') || 595 if (!((character >= 'A' && character <= 'Z') ||
@@ -628,7 +624,7 @@ u8 acpi_ut_valid_acpi_char(char character, acpi_native_uint position)
628 624
629u8 acpi_ut_valid_acpi_name(u32 name) 625u8 acpi_ut_valid_acpi_name(u32 name)
630{ 626{
631 acpi_native_uint i; 627 u32 i;
632 628
633 ACPI_FUNCTION_ENTRY(); 629 ACPI_FUNCTION_ENTRY();
634 630
@@ -657,7 +653,7 @@ u8 acpi_ut_valid_acpi_name(u32 name)
657 653
658acpi_name acpi_ut_repair_name(char *name) 654acpi_name acpi_ut_repair_name(char *name)
659{ 655{
660 acpi_native_uint i; 656 u32 i;
661 char new_name[ACPI_NAME_SIZE]; 657 char new_name[ACPI_NAME_SIZE];
662 658
663 for (i = 0; i < ACPI_NAME_SIZE; i++) { 659 for (i = 0; i < ACPI_NAME_SIZE; i++) {
@@ -1024,7 +1020,7 @@ acpi_ut_walk_package_tree(union acpi_operand_object * source_object,
1024 ******************************************************************************/ 1020 ******************************************************************************/
1025 1021
1026void ACPI_INTERNAL_VAR_XFACE 1022void ACPI_INTERNAL_VAR_XFACE
1027acpi_ut_error(char *module_name, u32 line_number, char *format, ...) 1023acpi_ut_error(const char *module_name, u32 line_number, const char *format, ...)
1028{ 1024{
1029 va_list args; 1025 va_list args;
1030 1026
@@ -1037,8 +1033,8 @@ acpi_ut_error(char *module_name, u32 line_number, char *format, ...)
1037} 1033}
1038 1034
1039void ACPI_INTERNAL_VAR_XFACE 1035void ACPI_INTERNAL_VAR_XFACE
1040acpi_ut_exception(char *module_name, 1036acpi_ut_exception(const char *module_name,
1041 u32 line_number, acpi_status status, char *format, ...) 1037 u32 line_number, acpi_status status, const char *format, ...)
1042{ 1038{
1043 va_list args; 1039 va_list args;
1044 1040
@@ -1054,7 +1050,8 @@ acpi_ut_exception(char *module_name,
1054EXPORT_SYMBOL(acpi_ut_exception); 1050EXPORT_SYMBOL(acpi_ut_exception);
1055 1051
1056void ACPI_INTERNAL_VAR_XFACE 1052void ACPI_INTERNAL_VAR_XFACE
1057acpi_ut_warning(char *module_name, u32 line_number, char *format, ...) 1053acpi_ut_warning(const char *module_name,
1054 u32 line_number, const char *format, ...)
1058{ 1055{
1059 va_list args; 1056 va_list args;
1060 1057
@@ -1067,7 +1064,7 @@ acpi_ut_warning(char *module_name, u32 line_number, char *format, ...)
1067} 1064}
1068 1065
1069void ACPI_INTERNAL_VAR_XFACE 1066void ACPI_INTERNAL_VAR_XFACE
1070acpi_ut_info(char *module_name, u32 line_number, char *format, ...) 1067acpi_ut_info(const char *module_name, u32 line_number, const char *format, ...)
1071{ 1068{
1072 va_list args; 1069 va_list args;
1073 1070
diff --git a/drivers/acpi/utilities/utmutex.c b/drivers/acpi/utilities/utmutex.c
index f7d602b1a894..7331dde9e1b3 100644
--- a/drivers/acpi/utilities/utmutex.c
+++ b/drivers/acpi/utilities/utmutex.c
@@ -218,7 +218,7 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id)
218 * the mutex ordering rule. This indicates a coding error somewhere in 218 * the mutex ordering rule. This indicates a coding error somewhere in
219 * the ACPI subsystem code. 219 * the ACPI subsystem code.
220 */ 220 */
221 for (i = mutex_id; i < ACPI_MAX_MUTEX; i++) { 221 for (i = mutex_id; i < ACPI_NUM_MUTEX; i++) {
222 if (acpi_gbl_mutex_info[i].thread_id == this_thread_id) { 222 if (acpi_gbl_mutex_info[i].thread_id == this_thread_id) {
223 if (i == mutex_id) { 223 if (i == mutex_id) {
224 ACPI_ERROR((AE_INFO, 224 ACPI_ERROR((AE_INFO,
@@ -315,7 +315,7 @@ acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id)
315 * ordering rule. This indicates a coding error somewhere in 315 * ordering rule. This indicates a coding error somewhere in
316 * the ACPI subsystem code. 316 * the ACPI subsystem code.
317 */ 317 */
318 for (i = mutex_id; i < ACPI_MAX_MUTEX; i++) { 318 for (i = mutex_id; i < ACPI_NUM_MUTEX; i++) {
319 if (acpi_gbl_mutex_info[i].thread_id == this_thread_id) { 319 if (acpi_gbl_mutex_info[i].thread_id == this_thread_id) {
320 if (i == mutex_id) { 320 if (i == mutex_id) {
321 continue; 321 continue;
diff --git a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c
index e68466de8044..e25484495e65 100644
--- a/drivers/acpi/utilities/utobject.c
+++ b/drivers/acpi/utilities/utobject.c
@@ -83,7 +83,8 @@ acpi_ut_get_element_length(u8 object_type,
83 * 83 *
84 ******************************************************************************/ 84 ******************************************************************************/
85 85
86union acpi_operand_object *acpi_ut_create_internal_object_dbg(char *module_name, 86union acpi_operand_object *acpi_ut_create_internal_object_dbg(const char
87 *module_name,
87 u32 line_number, 88 u32 line_number,
88 u32 component_id, 89 u32 component_id,
89 acpi_object_type 90 acpi_object_type
@@ -175,8 +176,8 @@ union acpi_operand_object *acpi_ut_create_package_object(u32 count)
175 * Create the element array. Count+1 allows the array to be null 176 * Create the element array. Count+1 allows the array to be null
176 * terminated. 177 * terminated.
177 */ 178 */
178 package_elements = ACPI_ALLOCATE_ZEROED((acpi_size) 179 package_elements = ACPI_ALLOCATE_ZEROED(((acpi_size) count +
179 (count + 1) * sizeof(void *)); 180 1) * sizeof(void *));
180 if (!package_elements) { 181 if (!package_elements) {
181 acpi_ut_remove_reference(package_desc); 182 acpi_ut_remove_reference(package_desc);
182 return_PTR(NULL); 183 return_PTR(NULL);
@@ -347,7 +348,7 @@ u8 acpi_ut_valid_internal_object(void *object)
347 * 348 *
348 ******************************************************************************/ 349 ******************************************************************************/
349 350
350void *acpi_ut_allocate_object_desc_dbg(char *module_name, 351void *acpi_ut_allocate_object_desc_dbg(const char *module_name,
351 u32 line_number, u32 component_id) 352 u32 line_number, u32 component_id)
352{ 353{
353 union acpi_operand_object *object; 354 union acpi_operand_object *object;