[ACPI] ACPICA 20051216
[sfrench/cifs-2.6.git] / drivers / acpi / utilities / utalloc.c
index 068450b36475a8b9b3552594bfcfbbf1409f87b0..b11b7ed788c675124c76419edf35b0f19b56433d 100644 (file)
@@ -47,7 +47,7 @@
 ACPI_MODULE_NAME("utalloc")
 
 /* Local prototypes */
-#ifdef ACPI_DBG_TRACK_ALLOCATIONS
+#ifdef ACPI_DBG_TRACK_ALLOCATIONS
 static struct acpi_debug_mem_block *acpi_ut_find_allocation(void *allocation);
 
 static acpi_status
@@ -58,9 +58,7 @@ acpi_ut_track_allocation(struct acpi_debug_mem_block *address,
 static acpi_status
 acpi_ut_remove_allocation(struct acpi_debug_mem_block *address,
                          u32 component, char *module, u32 line);
-#endif                         /* ACPI_DBG_TRACK_ALLOCATIONS */
 
-#ifdef ACPI_DBG_TRACK_ALLOCATIONS
 static acpi_status
 acpi_ut_create_list(char *list_name,
                    u16 object_size, struct acpi_memory_list **return_cache);
@@ -304,7 +302,7 @@ void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line)
 
        if (!size) {
                _ACPI_REPORT_ERROR(module, line, component,
-                                  ("ut_allocate: Attempt to allocate zero bytes\n"));
+                                  ("ut_allocate: Attempt to allocate zero bytes, allocating 1 byte\n"));
                size = 1;
        }
 
@@ -347,8 +345,8 @@ void *acpi_ut_callocate(acpi_size size, u32 component, char *module, u32 line)
 
        if (!size) {
                _ACPI_REPORT_ERROR(module, line, component,
-                                  ("ut_callocate: Attempt to allocate zero bytes\n"));
-               return_PTR(NULL);
+                                  ("ut_callocate: Attempt to allocate zero bytes, allocating 1 byte\n"));
+               size = 1;
        }
 
        allocation = acpi_os_allocate(size);
@@ -866,7 +864,7 @@ void acpi_ut_dump_allocations(u32 component, char *module)
 
        if (!num_outstanding) {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "No outstanding allocations.\n"));
+                                 "No outstanding allocations\n"));
        } else {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
                                  "%d(%X) Outstanding allocations\n",