aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities/utalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/utilities/utalloc.c')
-rw-r--r--drivers/acpi/utilities/utalloc.c51
1 files changed, 24 insertions, 27 deletions
diff --git a/drivers/acpi/utilities/utalloc.c b/drivers/acpi/utilities/utalloc.c
index 0efcbdf7e620..03b0044974c2 100644
--- a/drivers/acpi/utilities/utalloc.c
+++ b/drivers/acpi/utilities/utalloc.c
@@ -301,8 +301,8 @@ void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line)
301 /* Check for an inadvertent size of zero bytes */ 301 /* Check for an inadvertent size of zero bytes */
302 302
303 if (!size) { 303 if (!size) {
304 _ACPI_REPORT_ERROR(module, line, 304 ACPI_ERROR((module, line,
305 ("ut_allocate: Attempt to allocate zero bytes, allocating 1 byte\n")); 305 "ut_allocate: Attempt to allocate zero bytes, allocating 1 byte"));
306 size = 1; 306 size = 1;
307 } 307 }
308 308
@@ -310,9 +310,9 @@ void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line)
310 if (!allocation) { 310 if (!allocation) {
311 /* Report allocation error */ 311 /* Report allocation error */
312 312
313 _ACPI_REPORT_ERROR(module, line, 313 ACPI_ERROR((module, line,
314 ("ut_allocate: Could not allocate size %X\n", 314 "ut_allocate: Could not allocate size %X",
315 (u32) size)); 315 (u32) size));
316 316
317 return_PTR(NULL); 317 return_PTR(NULL);
318 } 318 }
@@ -344,8 +344,8 @@ void *acpi_ut_callocate(acpi_size size, u32 component, char *module, u32 line)
344 /* Check for an inadvertent size of zero bytes */ 344 /* Check for an inadvertent size of zero bytes */
345 345
346 if (!size) { 346 if (!size) {
347 _ACPI_REPORT_ERROR(module, line, 347 ACPI_ERROR((module, line,
348 ("ut_callocate: Attempt to allocate zero bytes, allocating 1 byte\n")); 348 "Attempt to allocate zero bytes, allocating 1 byte"));
349 size = 1; 349 size = 1;
350 } 350 }
351 351
@@ -353,9 +353,8 @@ void *acpi_ut_callocate(acpi_size size, u32 component, char *module, u32 line)
353 if (!allocation) { 353 if (!allocation) {
354 /* Report allocation error */ 354 /* Report allocation error */
355 355
356 _ACPI_REPORT_ERROR(module, line, 356 ACPI_ERROR((module, line,
357 ("ut_callocate: Could not allocate size %X\n", 357 "Could not allocate size %X", (u32) size));
358 (u32) size));
359 return_PTR(NULL); 358 return_PTR(NULL);
360 } 359 }
361 360
@@ -480,9 +479,8 @@ void *acpi_ut_callocate_and_track(acpi_size size,
480 if (!allocation) { 479 if (!allocation) {
481 /* Report allocation error */ 480 /* Report allocation error */
482 481
483 _ACPI_REPORT_ERROR(module, line, 482 ACPI_ERROR((module, line,
484 ("ut_callocate: Could not allocate size %X\n", 483 "Could not allocate size %X", (u32) size));
485 (u32) size));
486 return (NULL); 484 return (NULL);
487 } 485 }
488 486
@@ -524,8 +522,7 @@ acpi_ut_free_and_track(void *allocation, u32 component, char *module, u32 line)
524 ACPI_FUNCTION_TRACE_PTR("ut_free", allocation); 522 ACPI_FUNCTION_TRACE_PTR("ut_free", allocation);
525 523
526 if (NULL == allocation) { 524 if (NULL == allocation) {
527 _ACPI_REPORT_ERROR(module, line, 525 ACPI_ERROR((module, line, "Attempt to delete a NULL address"));
528 ("acpi_ut_free: Attempt to delete a NULL address\n"));
529 526
530 return_VOID; 527 return_VOID;
531 } 528 }
@@ -540,14 +537,11 @@ acpi_ut_free_and_track(void *allocation, u32 component, char *module, u32 line)
540 status = acpi_ut_remove_allocation(debug_block, 537 status = acpi_ut_remove_allocation(debug_block,
541 component, module, line); 538 component, module, line);
542 if (ACPI_FAILURE(status)) { 539 if (ACPI_FAILURE(status)) {
543 ACPI_REPORT_ERROR(("Could not free memory, %s\n", 540 ACPI_EXCEPTION((AE_INFO, status, "Could not free memory"));
544 acpi_format_exception(status)));
545 } 541 }
546 542
547 acpi_os_free(debug_block); 543 acpi_os_free(debug_block);
548
549 ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "%p freed\n", allocation)); 544 ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "%p freed\n", allocation));
550
551 return_VOID; 545 return_VOID;
552} 546}
553 547
@@ -624,10 +618,12 @@ acpi_ut_track_allocation(struct acpi_debug_mem_block *allocation,
624 */ 618 */
625 element = acpi_ut_find_allocation(allocation); 619 element = acpi_ut_find_allocation(allocation);
626 if (element) { 620 if (element) {
627 ACPI_REPORT_ERROR(("ut_track_allocation: Allocation already present in list! (%p)\n", allocation)); 621 ACPI_ERROR((AE_INFO,
622 "ut_track_allocation: Allocation already present in list! (%p)",
623 allocation));
628 624
629 ACPI_REPORT_ERROR(("Element %p Address %p\n", 625 ACPI_ERROR((AE_INFO, "Element %p Address %p",
630 element, allocation)); 626 element, allocation));
631 627
632 goto unlock_and_exit; 628 goto unlock_and_exit;
633 } 629 }
@@ -687,8 +683,8 @@ acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation,
687 if (NULL == mem_list->list_head) { 683 if (NULL == mem_list->list_head) {
688 /* No allocations! */ 684 /* No allocations! */
689 685
690 _ACPI_REPORT_ERROR(module, line, 686 ACPI_ERROR((module, line,
691 ("ut_remove_allocation: Empty allocation list, nothing to free!\n")); 687 "Empty allocation list, nothing to free!"));
692 688
693 return_ACPI_STATUS(AE_OK); 689 return_ACPI_STATUS(AE_OK);
694 } 690 }
@@ -863,10 +859,11 @@ void acpi_ut_dump_allocations(u32 component, char *module)
863 /* Print summary */ 859 /* Print summary */
864 860
865 if (!num_outstanding) { 861 if (!num_outstanding) {
866 ACPI_REPORT_INFO(("No outstanding allocations\n")); 862 ACPI_INFO((AE_INFO, "No outstanding allocations"));
867 } else { 863 } else {
868 ACPI_REPORT_ERROR(("%d(%X) Outstanding allocations\n", 864 ACPI_ERROR((AE_INFO,
869 num_outstanding, num_outstanding)); 865 "%d(%X) Outstanding allocations",
866 num_outstanding, num_outstanding));
870 } 867 }
871 868
872 return_VOID; 869 return_VOID;