diff --git a/drivers/acpi/utilities/utalloc.c b/drivers/acpi/utilities/utalloc.c
index 78270f5..068450b 100644
--- a/drivers/acpi/utilities/utalloc.c
+++ b/drivers/acpi/utilities/utalloc.c
@@ -41,45 +41,31 @@
  * POSSIBILITY OF SUCH DAMAGES.
  */
 
-
 #include <acpi/acpi.h>
 
 #define _COMPONENT          ACPI_UTILITIES
-	 ACPI_MODULE_NAME    ("utalloc")
+ACPI_MODULE_NAME("utalloc")
 
 /* Local prototypes */
-
 #ifdef	ACPI_DBG_TRACK_ALLOCATIONS
-static struct acpi_debug_mem_block *
-acpi_ut_find_allocation (
-	void                            *allocation);
+static struct acpi_debug_mem_block *acpi_ut_find_allocation(void *allocation);
 
 static acpi_status
-acpi_ut_track_allocation (
-	struct acpi_debug_mem_block     *address,
-	acpi_size                       size,
-	u8                              alloc_type,
-	u32                             component,
-	char                            *module,
-	u32                             line);
+acpi_ut_track_allocation(struct acpi_debug_mem_block *address,
+			 acpi_size size,
+			 u8 alloc_type, u32 component, char *module, u32 line);
 
 static acpi_status
-acpi_ut_remove_allocation (
-	struct acpi_debug_mem_block     *address,
-	u32                             component,
-	char                            *module,
-	u32                             line);
-#endif	/* ACPI_DBG_TRACK_ALLOCATIONS */
+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);
+acpi_ut_create_list(char *list_name,
+		    u16 object_size, struct acpi_memory_list **return_cache);
 #endif
 
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_create_caches
@@ -92,60 +78,68 @@
  *
  ******************************************************************************/
 
-acpi_status
-acpi_ut_create_caches (
-	void)
+acpi_status acpi_ut_create_caches(void)
 {
-	acpi_status                     status;
-
+	acpi_status status;
 
 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
 
 	/* Memory allocation lists */
 
-	status = acpi_ut_create_list ("Acpi-Global", 0,
-			 &acpi_gbl_global_list);
-	if (ACPI_FAILURE (status)) {
+	status = acpi_ut_create_list("Acpi-Global", 0, &acpi_gbl_global_list);
+	if (ACPI_FAILURE(status)) {
 		return (status);
 	}
 
-	status = acpi_ut_create_list ("Acpi-Namespace", sizeof (struct acpi_namespace_node),
-			 &acpi_gbl_ns_node_list);
-	if (ACPI_FAILURE (status)) {
+	status =
+	    acpi_ut_create_list("Acpi-Namespace",
+				sizeof(struct acpi_namespace_node),
+				&acpi_gbl_ns_node_list);
+	if (ACPI_FAILURE(status)) {
 		return (status);
 	}
 #endif
 
 	/* Object Caches, for frequently used objects */
 
-	status = acpi_os_create_cache ("acpi_state", sizeof (union acpi_generic_state),
-			 ACPI_MAX_STATE_CACHE_DEPTH, &acpi_gbl_state_cache);
-	if (ACPI_FAILURE (status)) {
+	status =
+	    acpi_os_create_cache("acpi_state", sizeof(union acpi_generic_state),
+				 ACPI_MAX_STATE_CACHE_DEPTH,
+				 &acpi_gbl_state_cache);
+	if (ACPI_FAILURE(status)) {
 		return (status);
 	}
 
-	status = acpi_os_create_cache ("acpi_parse", sizeof (struct acpi_parse_obj_common),
-			 ACPI_MAX_PARSE_CACHE_DEPTH, &acpi_gbl_ps_node_cache);
-	if (ACPI_FAILURE (status)) {
+	status =
+	    acpi_os_create_cache("acpi_parse",
+				 sizeof(struct acpi_parse_obj_common),
+				 ACPI_MAX_PARSE_CACHE_DEPTH,
+				 &acpi_gbl_ps_node_cache);
+	if (ACPI_FAILURE(status)) {
 		return (status);
 	}
 
-	status = acpi_os_create_cache ("acpi_parse_ext", sizeof (struct acpi_parse_obj_named),
-			 ACPI_MAX_EXTPARSE_CACHE_DEPTH, &acpi_gbl_ps_node_ext_cache);
-	if (ACPI_FAILURE (status)) {
+	status =
+	    acpi_os_create_cache("acpi_parse_ext",
+				 sizeof(struct acpi_parse_obj_named),
+				 ACPI_MAX_EXTPARSE_CACHE_DEPTH,
+				 &acpi_gbl_ps_node_ext_cache);
+	if (ACPI_FAILURE(status)) {
 		return (status);
 	}
 
-	status = acpi_os_create_cache ("acpi_operand", sizeof (union acpi_operand_object),
-			 ACPI_MAX_OBJECT_CACHE_DEPTH, &acpi_gbl_operand_cache);
-	if (ACPI_FAILURE (status)) {
+	status =
+	    acpi_os_create_cache("acpi_operand",
+				 sizeof(union acpi_operand_object),
+				 ACPI_MAX_OBJECT_CACHE_DEPTH,
+				 &acpi_gbl_operand_cache);
+	if (ACPI_FAILURE(status)) {
 		return (status);
 	}
 
 	return (AE_OK);
 }
 
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_delete_caches
@@ -158,21 +152,19 @@
  *
  ******************************************************************************/
 
-acpi_status
-acpi_ut_delete_caches (
-	void)
+acpi_status acpi_ut_delete_caches(void)
 {
 
-	(void) acpi_os_delete_cache (acpi_gbl_state_cache);
+	(void)acpi_os_delete_cache(acpi_gbl_state_cache);
 	acpi_gbl_state_cache = NULL;
 
-	(void) acpi_os_delete_cache (acpi_gbl_operand_cache);
+	(void)acpi_os_delete_cache(acpi_gbl_operand_cache);
 	acpi_gbl_operand_cache = NULL;
 
-	(void) acpi_os_delete_cache (acpi_gbl_ps_node_cache);
+	(void)acpi_os_delete_cache(acpi_gbl_ps_node_cache);
 	acpi_gbl_ps_node_cache = NULL;
 
-	(void) acpi_os_delete_cache (acpi_gbl_ps_node_ext_cache);
+	(void)acpi_os_delete_cache(acpi_gbl_ps_node_ext_cache);
 	acpi_gbl_ps_node_ext_cache = NULL;
 
 	return (AE_OK);
@@ -190,9 +182,7 @@
  *
  ******************************************************************************/
 
-acpi_status
-acpi_ut_validate_buffer (
-	struct acpi_buffer              *buffer)
+acpi_status acpi_ut_validate_buffer(struct acpi_buffer * buffer)
 {
 
 	/* Obviously, the structure pointer must be valid */
@@ -203,9 +193,9 @@
 
 	/* Special semantics for the length */
 
-	if ((buffer->length == ACPI_NO_BUFFER)              ||
-		(buffer->length == ACPI_ALLOCATE_BUFFER)        ||
-		(buffer->length == ACPI_ALLOCATE_LOCAL_BUFFER)) {
+	if ((buffer->length == ACPI_NO_BUFFER) ||
+	    (buffer->length == ACPI_ALLOCATE_BUFFER) ||
+	    (buffer->length == ACPI_ALLOCATE_LOCAL_BUFFER)) {
 		return (AE_OK);
 	}
 
@@ -218,7 +208,6 @@
 	return (AE_OK);
 }
 
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_initialize_buffer
@@ -234,12 +223,10 @@
  ******************************************************************************/
 
 acpi_status
-acpi_ut_initialize_buffer (
-	struct acpi_buffer              *buffer,
-	acpi_size                       required_length)
+acpi_ut_initialize_buffer(struct acpi_buffer * buffer,
+			  acpi_size required_length)
 {
-	acpi_status                     status = AE_OK;
-
+	acpi_status status = AE_OK;
 
 	switch (buffer->length) {
 	case ACPI_NO_BUFFER:
@@ -249,33 +236,30 @@
 		status = AE_BUFFER_OVERFLOW;
 		break;
 
-
 	case ACPI_ALLOCATE_BUFFER:
 
 		/* Allocate a new buffer */
 
-		buffer->pointer = acpi_os_allocate (required_length);
+		buffer->pointer = acpi_os_allocate(required_length);
 		if (!buffer->pointer) {
 			return (AE_NO_MEMORY);
 		}
 
 		/* Clear the buffer */
 
-		ACPI_MEMSET (buffer->pointer, 0, required_length);
+		ACPI_MEMSET(buffer->pointer, 0, required_length);
 		break;
 
-
 	case ACPI_ALLOCATE_LOCAL_BUFFER:
 
 		/* Allocate a new buffer with local interface to allow tracking */
 
-		buffer->pointer = ACPI_MEM_CALLOCATE (required_length);
+		buffer->pointer = ACPI_MEM_CALLOCATE(required_length);
 		if (!buffer->pointer) {
 			return (AE_NO_MEMORY);
 		}
 		break;
 
-
 	default:
 
 		/* Existing buffer: Validate the size of the buffer */
@@ -287,7 +271,7 @@
 
 		/* Clear the buffer */
 
-		ACPI_MEMSET (buffer->pointer, 0, required_length);
+		ACPI_MEMSET(buffer->pointer, 0, required_length);
 		break;
 	}
 
@@ -295,7 +279,6 @@
 	return (status);
 }
 
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_allocate
@@ -311,41 +294,34 @@
  *
  ******************************************************************************/
 
-void *
-acpi_ut_allocate (
-	acpi_size                       size,
-	u32                             component,
-	char                            *module,
-	u32                             line)
+void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line)
 {
-	void                            *allocation;
+	void *allocation;
 
-
-	ACPI_FUNCTION_TRACE_U32 ("ut_allocate", size);
-
+	ACPI_FUNCTION_TRACE_U32("ut_allocate", size);
 
 	/* Check for an inadvertent size of zero bytes */
 
 	if (!size) {
-		_ACPI_REPORT_ERROR (module, line, component,
-				("ut_allocate: Attempt to allocate zero bytes\n"));
+		_ACPI_REPORT_ERROR(module, line, component,
+				   ("ut_allocate: Attempt to allocate zero bytes\n"));
 		size = 1;
 	}
 
-	allocation = acpi_os_allocate (size);
+	allocation = acpi_os_allocate(size);
 	if (!allocation) {
 		/* Report allocation error */
 
-		_ACPI_REPORT_ERROR (module, line, component,
-				("ut_allocate: Could not allocate size %X\n", (u32) size));
+		_ACPI_REPORT_ERROR(module, line, component,
+				   ("ut_allocate: Could not allocate size %X\n",
+				    (u32) size));
 
-		return_PTR (NULL);
+		return_PTR(NULL);
 	}
 
-	return_PTR (allocation);
+	return_PTR(allocation);
 }
 
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_callocate
@@ -361,43 +337,36 @@
  *
  ******************************************************************************/
 
-void *
-acpi_ut_callocate (
-	acpi_size                       size,
-	u32                             component,
-	char                            *module,
-	u32                             line)
+void *acpi_ut_callocate(acpi_size size, u32 component, char *module, u32 line)
 {
-	void                            *allocation;
+	void *allocation;
 
-
-	ACPI_FUNCTION_TRACE_U32 ("ut_callocate", size);
-
+	ACPI_FUNCTION_TRACE_U32("ut_callocate", size);
 
 	/* Check for an inadvertent size of zero bytes */
 
 	if (!size) {
-		_ACPI_REPORT_ERROR (module, line, component,
-				("ut_callocate: Attempt to allocate zero bytes\n"));
-		return_PTR (NULL);
+		_ACPI_REPORT_ERROR(module, line, component,
+				   ("ut_callocate: Attempt to allocate zero bytes\n"));
+		return_PTR(NULL);
 	}
 
-	allocation = acpi_os_allocate (size);
+	allocation = acpi_os_allocate(size);
 	if (!allocation) {
 		/* Report allocation error */
 
-		_ACPI_REPORT_ERROR (module, line, component,
-				("ut_callocate: Could not allocate size %X\n", (u32) size));
-		return_PTR (NULL);
+		_ACPI_REPORT_ERROR(module, line, component,
+				   ("ut_callocate: Could not allocate size %X\n",
+				    (u32) size));
+		return_PTR(NULL);
 	}
 
 	/* Clear the memory block */
 
-	ACPI_MEMSET (allocation, 0, size);
-	return_PTR (allocation);
+	ACPI_MEMSET(allocation, 0, size);
+	return_PTR(allocation);
 }
 
-
 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
 /*
  * These procedures are used for tracking memory leaks in the subsystem, and
@@ -425,29 +394,25 @@
  ******************************************************************************/
 
 static acpi_status
-acpi_ut_create_list (
-	char                            *list_name,
-	u16                             object_size,
-	struct acpi_memory_list         **return_cache)
+acpi_ut_create_list(char *list_name,
+		    u16 object_size, struct acpi_memory_list **return_cache)
 {
-	struct acpi_memory_list         *cache;
+	struct acpi_memory_list *cache;
 
-
-	cache = acpi_os_allocate (sizeof (struct acpi_memory_list));
+	cache = acpi_os_allocate(sizeof(struct acpi_memory_list));
 	if (!cache) {
 		return (AE_NO_MEMORY);
 	}
 
-	ACPI_MEMSET (cache, 0, sizeof (struct acpi_memory_list));
+	ACPI_MEMSET(cache, 0, sizeof(struct acpi_memory_list));
 
-	cache->list_name  = list_name;
+	cache->list_name = list_name;
 	cache->object_size = object_size;
 
 	*return_cache = cache;
 	return (AE_OK);
 }
 
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_allocate_and_track
@@ -463,37 +428,33 @@
  *
  ******************************************************************************/
 
-void *
-acpi_ut_allocate_and_track (
-	acpi_size                       size,
-	u32                             component,
-	char                            *module,
-	u32                             line)
+void *acpi_ut_allocate_and_track(acpi_size size,
+				 u32 component, char *module, u32 line)
 {
-	struct acpi_debug_mem_block     *allocation;
-	acpi_status                     status;
+	struct acpi_debug_mem_block *allocation;
+	acpi_status status;
 
-
-	allocation = acpi_ut_allocate (size + sizeof (struct acpi_debug_mem_header),
-			  component, module, line);
+	allocation =
+	    acpi_ut_allocate(size + sizeof(struct acpi_debug_mem_header),
+			     component, module, line);
 	if (!allocation) {
 		return (NULL);
 	}
 
-	status = acpi_ut_track_allocation (allocation, size,
-			  ACPI_MEM_MALLOC, component, module, line);
-	if (ACPI_FAILURE (status)) {
-		acpi_os_free (allocation);
+	status = acpi_ut_track_allocation(allocation, size,
+					  ACPI_MEM_MALLOC, component, module,
+					  line);
+	if (ACPI_FAILURE(status)) {
+		acpi_os_free(allocation);
 		return (NULL);
 	}
 
 	acpi_gbl_global_list->total_allocated++;
 	acpi_gbl_global_list->current_total_size += (u32) size;
 
-	return ((void *) &allocation->user_space);
+	return ((void *)&allocation->user_space);
 }
 
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_callocate_and_track
@@ -509,41 +470,38 @@
  *
  ******************************************************************************/
 
-void *
-acpi_ut_callocate_and_track (
-	acpi_size                       size,
-	u32                             component,
-	char                            *module,
-	u32                             line)
+void *acpi_ut_callocate_and_track(acpi_size size,
+				  u32 component, char *module, u32 line)
 {
-	struct acpi_debug_mem_block     *allocation;
-	acpi_status                     status;
+	struct acpi_debug_mem_block *allocation;
+	acpi_status status;
 
-
-	allocation = acpi_ut_callocate (size + sizeof (struct acpi_debug_mem_header),
-			  component, module, line);
+	allocation =
+	    acpi_ut_callocate(size + sizeof(struct acpi_debug_mem_header),
+			      component, module, line);
 	if (!allocation) {
 		/* Report allocation error */
 
-		_ACPI_REPORT_ERROR (module, line, component,
-				("ut_callocate: Could not allocate size %X\n", (u32) size));
+		_ACPI_REPORT_ERROR(module, line, component,
+				   ("ut_callocate: Could not allocate size %X\n",
+				    (u32) size));
 		return (NULL);
 	}
 
-	status = acpi_ut_track_allocation (allocation, size,
-			   ACPI_MEM_CALLOC, component, module, line);
-	if (ACPI_FAILURE (status)) {
-		acpi_os_free (allocation);
+	status = acpi_ut_track_allocation(allocation, size,
+					  ACPI_MEM_CALLOC, component, module,
+					  line);
+	if (ACPI_FAILURE(status)) {
+		acpi_os_free(allocation);
 		return (NULL);
 	}
 
 	acpi_gbl_global_list->total_allocated++;
 	acpi_gbl_global_list->current_total_size += (u32) size;
 
-	return ((void *) &allocation->user_space);
+	return ((void *)&allocation->user_space);
 }
 
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_free_and_track
@@ -560,47 +518,41 @@
  ******************************************************************************/
 
 void
-acpi_ut_free_and_track (
-	void                            *allocation,
-	u32                             component,
-	char                            *module,
-	u32                             line)
+acpi_ut_free_and_track(void *allocation, u32 component, char *module, u32 line)
 {
-	struct acpi_debug_mem_block     *debug_block;
-	acpi_status                     status;
+	struct acpi_debug_mem_block *debug_block;
+	acpi_status status;
 
-
-	ACPI_FUNCTION_TRACE_PTR ("ut_free", allocation);
-
+	ACPI_FUNCTION_TRACE_PTR("ut_free", allocation);
 
 	if (NULL == allocation) {
-		_ACPI_REPORT_ERROR (module, line, component,
-			("acpi_ut_free: Attempt to delete a NULL address\n"));
+		_ACPI_REPORT_ERROR(module, line, component,
+				   ("acpi_ut_free: Attempt to delete a NULL address\n"));
 
 		return_VOID;
 	}
 
-	debug_block = ACPI_CAST_PTR (struct acpi_debug_mem_block,
-			  (((char *) allocation) - sizeof (struct acpi_debug_mem_header)));
+	debug_block = ACPI_CAST_PTR(struct acpi_debug_mem_block,
+				    (((char *)allocation) -
+				     sizeof(struct acpi_debug_mem_header)));
 
 	acpi_gbl_global_list->total_freed++;
 	acpi_gbl_global_list->current_total_size -= debug_block->size;
 
-	status = acpi_ut_remove_allocation (debug_block,
-			  component, module, line);
-	if (ACPI_FAILURE (status)) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not free memory, %s\n",
-			acpi_format_exception (status)));
+	status = acpi_ut_remove_allocation(debug_block,
+					   component, module, line);
+	if (ACPI_FAILURE(status)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Could not free memory, %s\n",
+				  acpi_format_exception(status)));
 	}
 
-	acpi_os_free (debug_block);
+	acpi_os_free(debug_block);
 
-	ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p freed\n", allocation));
+	ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "%p freed\n", allocation));
 
 	return_VOID;
 }
 
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_find_allocation
@@ -613,15 +565,11 @@
  *
  ******************************************************************************/
 
-static struct acpi_debug_mem_block *
-acpi_ut_find_allocation (
-	void                            *allocation)
+static struct acpi_debug_mem_block *acpi_ut_find_allocation(void *allocation)
 {
-	struct acpi_debug_mem_block     *element;
+	struct acpi_debug_mem_block *element;
 
-
-	ACPI_FUNCTION_ENTRY ();
-
+	ACPI_FUNCTION_ENTRY();
 
 	element = acpi_gbl_global_list->list_head;
 
@@ -638,7 +586,6 @@
 	return (NULL);
 }
 
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_track_allocation
@@ -657,58 +604,51 @@
  ******************************************************************************/
 
 static acpi_status
-acpi_ut_track_allocation (
-	struct acpi_debug_mem_block     *allocation,
-	acpi_size                       size,
-	u8                              alloc_type,
-	u32                             component,
-	char                            *module,
-	u32                             line)
+acpi_ut_track_allocation(struct acpi_debug_mem_block *allocation,
+			 acpi_size size,
+			 u8 alloc_type, u32 component, char *module, u32 line)
 {
-	struct acpi_memory_list         *mem_list;
-	struct acpi_debug_mem_block     *element;
-	acpi_status                     status = AE_OK;
+	struct acpi_memory_list *mem_list;
+	struct acpi_debug_mem_block *element;
+	acpi_status status = AE_OK;
 
-
-	ACPI_FUNCTION_TRACE_PTR ("ut_track_allocation", allocation);
-
+	ACPI_FUNCTION_TRACE_PTR("ut_track_allocation", allocation);
 
 	mem_list = acpi_gbl_global_list;
-	status = acpi_ut_acquire_mutex (ACPI_MTX_MEMORY);
-	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
+	status = acpi_ut_acquire_mutex(ACPI_MTX_MEMORY);
+	if (ACPI_FAILURE(status)) {
+		return_ACPI_STATUS(status);
 	}
 
 	/*
 	 * Search list for this address to make sure it is not already on the list.
 	 * This will catch several kinds of problems.
 	 */
-	element = acpi_ut_find_allocation (allocation);
+	element = acpi_ut_find_allocation(allocation);
 	if (element) {
-		ACPI_REPORT_ERROR ((
-			"ut_track_allocation: Allocation already present in list! (%p)\n",
-			allocation));
+		ACPI_REPORT_ERROR(("ut_track_allocation: Allocation already present in list! (%p)\n", allocation));
 
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Element %p Address %p\n",
-			element, allocation));
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Element %p Address %p\n",
+				  element, allocation));
 
 		goto unlock_and_exit;
 	}
 
 	/* Fill in the instance data. */
 
-	allocation->size      = (u32) size;
+	allocation->size = (u32) size;
 	allocation->alloc_type = alloc_type;
 	allocation->component = component;
-	allocation->line      = line;
+	allocation->line = line;
 
-	ACPI_STRNCPY (allocation->module, module, ACPI_MAX_MODULE_NAME);
-	allocation->module[ACPI_MAX_MODULE_NAME-1] = 0;
+	ACPI_STRNCPY(allocation->module, module, ACPI_MAX_MODULE_NAME);
+	allocation->module[ACPI_MAX_MODULE_NAME - 1] = 0;
 
 	/* Insert at list head */
 
 	if (mem_list->list_head) {
-		((struct acpi_debug_mem_block *)(mem_list->list_head))->previous = allocation;
+		((struct acpi_debug_mem_block *)(mem_list->list_head))->
+		    previous = allocation;
 	}
 
 	allocation->next = mem_list->list_head;
@@ -716,13 +656,11 @@
 
 	mem_list->list_head = allocation;
 
-
-unlock_and_exit:
-	status = acpi_ut_release_mutex (ACPI_MTX_MEMORY);
-	return_ACPI_STATUS (status);
+      unlock_and_exit:
+	status = acpi_ut_release_mutex(ACPI_MTX_MEMORY);
+	return_ACPI_STATUS(status);
 }
 
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_remove_allocation
@@ -739,40 +677,34 @@
  ******************************************************************************/
 
 static acpi_status
-acpi_ut_remove_allocation (
-	struct acpi_debug_mem_block     *allocation,
-	u32                             component,
-	char                            *module,
-	u32                             line)
+acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation,
+			  u32 component, char *module, u32 line)
 {
-	struct acpi_memory_list         *mem_list;
-	acpi_status                     status;
+	struct acpi_memory_list *mem_list;
+	acpi_status status;
 
-
-	ACPI_FUNCTION_TRACE ("ut_remove_allocation");
-
+	ACPI_FUNCTION_TRACE("ut_remove_allocation");
 
 	mem_list = acpi_gbl_global_list;
 	if (NULL == mem_list->list_head) {
 		/* No allocations! */
 
-		_ACPI_REPORT_ERROR (module, line, component,
-			("ut_remove_allocation: Empty allocation list, nothing to free!\n"));
+		_ACPI_REPORT_ERROR(module, line, component,
+				   ("ut_remove_allocation: Empty allocation list, nothing to free!\n"));
 
-		return_ACPI_STATUS (AE_OK);
+		return_ACPI_STATUS(AE_OK);
 	}
 
-	status = acpi_ut_acquire_mutex (ACPI_MTX_MEMORY);
-	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
+	status = acpi_ut_acquire_mutex(ACPI_MTX_MEMORY);
+	if (ACPI_FAILURE(status)) {
+		return_ACPI_STATUS(status);
 	}
 
 	/* Unlink */
 
 	if (allocation->previous) {
 		(allocation->previous)->next = allocation->next;
-	}
-	else {
+	} else {
 		mem_list->list_head = allocation->next;
 	}
 
@@ -782,16 +714,15 @@
 
 	/* Mark the segment as deleted */
 
-	ACPI_MEMSET (&allocation->user_space, 0xEA, allocation->size);
+	ACPI_MEMSET(&allocation->user_space, 0xEA, allocation->size);
 
-	ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Freeing size 0%X\n",
-		allocation->size));
+	ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "Freeing size 0%X\n",
+			  allocation->size));
 
-	status = acpi_ut_release_mutex (ACPI_MTX_MEMORY);
-	return_ACPI_STATUS (status);
+	status = acpi_ut_release_mutex(ACPI_MTX_MEMORY);
+	return_ACPI_STATUS(status);
 }
 
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_dump_allocation_info
@@ -805,15 +736,13 @@
  ******************************************************************************/
 
 #ifdef ACPI_FUTURE_USAGE
-void
-acpi_ut_dump_allocation_info (
-	void)
+void acpi_ut_dump_allocation_info(void)
 {
 /*
 	struct acpi_memory_list         *mem_list;
 */
 
-	ACPI_FUNCTION_TRACE ("ut_dump_allocation_info");
+	ACPI_FUNCTION_TRACE("ut_dump_allocation_info");
 
 /*
 	ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
@@ -826,7 +755,6 @@
 			  mem_list->max_concurrent_count,
 			  ROUND_UP_TO_1K (mem_list->max_concurrent_size)));
 
-
 	ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
 			  ("%30s: %4d (%3d Kb)\n", "Total (all) internal objects",
 			  running_object_count,
@@ -837,7 +765,6 @@
 			  running_alloc_count,
 			  ROUND_UP_TO_1K (running_alloc_size)));
 
-
 	ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
 			  ("%30s: %4d (%3d Kb)\n", "Current Nodes",
 			  acpi_gbl_current_node_count,
@@ -851,8 +778,7 @@
 */
 	return_VOID;
 }
-#endif  /*  ACPI_FUTURE_USAGE  */
-
+#endif				/*  ACPI_FUTURE_USAGE  */
 
 /*******************************************************************************
  *
@@ -867,84 +793,87 @@
  *
  ******************************************************************************/
 
-void
-acpi_ut_dump_allocations (
-	u32                             component,
-	char                            *module)
+void acpi_ut_dump_allocations(u32 component, char *module)
 {
-	struct acpi_debug_mem_block     *element;
-	union acpi_descriptor           *descriptor;
-	u32                             num_outstanding = 0;
+	struct acpi_debug_mem_block *element;
+	union acpi_descriptor *descriptor;
+	u32 num_outstanding = 0;
 
-
-	ACPI_FUNCTION_TRACE ("ut_dump_allocations");
-
+	ACPI_FUNCTION_TRACE("ut_dump_allocations");
 
 	/*
 	 * Walk the allocation list.
 	 */
-	if (ACPI_FAILURE (acpi_ut_acquire_mutex (ACPI_MTX_MEMORY))) {
+	if (ACPI_FAILURE(acpi_ut_acquire_mutex(ACPI_MTX_MEMORY))) {
 		return;
 	}
 
 	element = acpi_gbl_global_list->list_head;
 	while (element) {
 		if ((element->component & component) &&
-			((module == NULL) || (0 == ACPI_STRCMP (module, element->module)))) {
+		    ((module == NULL)
+		     || (0 == ACPI_STRCMP(module, element->module)))) {
 			/* Ignore allocated objects that are in a cache */
 
-			descriptor = ACPI_CAST_PTR (union acpi_descriptor, &element->user_space);
+			descriptor =
+			    ACPI_CAST_PTR(union acpi_descriptor,
+					  &element->user_space);
 			if (descriptor->descriptor_id != ACPI_DESC_TYPE_CACHED) {
-				acpi_os_printf ("%p Len %04X %9.9s-%d [%s] ",
-					descriptor, element->size, element->module,
-					element->line, acpi_ut_get_descriptor_name (descriptor));
+				acpi_os_printf("%p Len %04X %9.9s-%d [%s] ",
+					       descriptor, element->size,
+					       element->module, element->line,
+					       acpi_ut_get_descriptor_name
+					       (descriptor));
 
 				/* Most of the elements will be Operand objects. */
 
-				switch (ACPI_GET_DESCRIPTOR_TYPE (descriptor)) {
+				switch (ACPI_GET_DESCRIPTOR_TYPE(descriptor)) {
 				case ACPI_DESC_TYPE_OPERAND:
-					acpi_os_printf ("%12.12s R%hd",
-						acpi_ut_get_type_name (descriptor->object.common.type),
-						descriptor->object.common.reference_count);
+					acpi_os_printf("%12.12s R%hd",
+						       acpi_ut_get_type_name
+						       (descriptor->object.
+							common.type),
+						       descriptor->object.
+						       common.reference_count);
 					break;
 
 				case ACPI_DESC_TYPE_PARSER:
-					acpi_os_printf ("aml_opcode %04hX",
-						descriptor->op.asl.aml_opcode);
+					acpi_os_printf("aml_opcode %04hX",
+						       descriptor->op.asl.
+						       aml_opcode);
 					break;
 
 				case ACPI_DESC_TYPE_NAMED:
-					acpi_os_printf ("%4.4s",
-						acpi_ut_get_node_name (&descriptor->node));
+					acpi_os_printf("%4.4s",
+						       acpi_ut_get_node_name
+						       (&descriptor->node));
 					break;
 
 				default:
 					break;
 				}
 
-				acpi_os_printf ( "\n");
+				acpi_os_printf("\n");
 				num_outstanding++;
 			}
 		}
 		element = element->next;
 	}
 
-	(void) acpi_ut_release_mutex (ACPI_MTX_MEMORY);
+	(void)acpi_ut_release_mutex(ACPI_MTX_MEMORY);
 
 	/* Print summary */
 
 	if (!num_outstanding) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-			"No outstanding allocations.\n"));
-	}
-	else {
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-			"%d(%X) Outstanding allocations\n",
-			num_outstanding, num_outstanding));
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+				  "No outstanding allocations.\n"));
+	} else {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+				  "%d(%X) Outstanding allocations\n",
+				  num_outstanding, num_outstanding));
 	}
 
 	return_VOID;
 }
 
-#endif  /* #ifdef ACPI_DBG_TRACK_ALLOCATIONS */
-
+#endif				/* #ifdef ACPI_DBG_TRACK_ALLOCATIONS */
