]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/utilities/utstate.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6
[linux-2.6-omap-h63xx.git] / drivers / acpi / utilities / utstate.c
index 192e7ac95690d8794b13fab26c3d73f39238ac5f..4b134a72290711b81753003c81c30ed170386abb 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2005, R. Byron Moore
+ * Copyright (C) 2000 - 2006, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * POSSIBILITY OF SUCH DAMAGES.
  */
 
-
 #include <acpi/acpi.h>
 
 #define _COMPONENT          ACPI_UTILITIES
-        ACPI_MODULE_NAME    ("utstate")
-
+ACPI_MODULE_NAME("utstate")
 
 /*******************************************************************************
  *
  * DESCRIPTION: Create a new state and push it
  *
  ******************************************************************************/
-
 acpi_status
-acpi_ut_create_pkg_state_and_push (
-       void                            *internal_object,
-       void                            *external_object,
-       u16                             index,
-       union acpi_generic_state        **state_list)
+acpi_ut_create_pkg_state_and_push(void *internal_object,
+                                 void *external_object,
+                                 u16 index,
+                                 union acpi_generic_state **state_list)
 {
-       union acpi_generic_state         *state;
-
+       union acpi_generic_state *state;
 
-       ACPI_FUNCTION_ENTRY ();
+       ACPI_FUNCTION_ENTRY();
 
-
-       state = acpi_ut_create_pkg_state (internal_object, external_object, index);
+       state =
+           acpi_ut_create_pkg_state(internal_object, external_object, index);
        if (!state) {
                return (AE_NO_MEMORY);
        }
 
-       acpi_ut_push_generic_state (state_list, state);
+       acpi_ut_push_generic_state(state_list, state);
        return (AE_OK);
 }
 
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_push_generic_state
@@ -99,12 +93,10 @@ acpi_ut_create_pkg_state_and_push (
  ******************************************************************************/
 
 void
-acpi_ut_push_generic_state (
-       union acpi_generic_state        **list_head,
-       union acpi_generic_state        *state)
+acpi_ut_push_generic_state(union acpi_generic_state **list_head,
+                          union acpi_generic_state *state)
 {
-       ACPI_FUNCTION_TRACE ("ut_push_generic_state");
-
+       ACPI_FUNCTION_TRACE("ut_push_generic_state");
 
        /* Push the state object onto the front of the list (stack) */
 
@@ -114,7 +106,6 @@ acpi_ut_push_generic_state (
        return_VOID;
 }
 
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_pop_generic_state
@@ -127,15 +118,12 @@ acpi_ut_push_generic_state (
  *
  ******************************************************************************/
 
-union acpi_generic_state *
-acpi_ut_pop_generic_state (
-       union acpi_generic_state        **list_head)
+union acpi_generic_state *acpi_ut_pop_generic_state(union acpi_generic_state
+                                                   **list_head)
 {
-       union acpi_generic_state        *state;
-
-
-       ACPI_FUNCTION_TRACE ("ut_pop_generic_state");
+       union acpi_generic_state *state;
 
+       ACPI_FUNCTION_TRACE("ut_pop_generic_state");
 
        /* Remove the state object at the head of the list (stack) */
 
@@ -146,10 +134,9 @@ acpi_ut_pop_generic_state (
                *list_head = state->common.next;
        }
 
-       return_PTR (state);
+       return_PTR(state);
 }
 
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_create_generic_state
@@ -163,17 +150,13 @@ acpi_ut_pop_generic_state (
  *
  ******************************************************************************/
 
-union acpi_generic_state *
-acpi_ut_create_generic_state (
-       void)
+union acpi_generic_state *acpi_ut_create_generic_state(void)
 {
-       union acpi_generic_state        *state;
-
+       union acpi_generic_state *state;
 
-       ACPI_FUNCTION_ENTRY ();
+       ACPI_FUNCTION_ENTRY();
 
-
-       state = acpi_os_acquire_object (acpi_gbl_state_cache);
+       state = acpi_os_acquire_object(acpi_gbl_state_cache);
        if (state) {
                /* Initialize */
                memset(state, 0, sizeof(union acpi_generic_state));
@@ -183,7 +166,6 @@ acpi_ut_create_generic_state (
        return (state);
 }
 
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_create_thread_state
@@ -197,32 +179,27 @@ acpi_ut_create_generic_state (
  *
  ******************************************************************************/
 
-struct acpi_thread_state *
-acpi_ut_create_thread_state (
-       void)
+struct acpi_thread_state *acpi_ut_create_thread_state(void)
 {
-       union acpi_generic_state        *state;
-
-
-       ACPI_FUNCTION_TRACE ("ut_create_thread_state");
+       union acpi_generic_state *state;
 
+       ACPI_FUNCTION_TRACE("ut_create_thread_state");
 
        /* Create the generic state object */
 
-       state = acpi_ut_create_generic_state ();
+       state = acpi_ut_create_generic_state();
        if (!state) {
-               return_PTR (NULL);
+               return_PTR(NULL);
        }
 
        /* Init fields specific to the update struct */
 
        state->common.data_type = ACPI_DESC_TYPE_STATE_THREAD;
-       state->thread.thread_id = acpi_os_get_thread_id ();
+       state->thread.thread_id = acpi_os_get_thread_id();
 
-       return_PTR ((struct acpi_thread_state *) state);
+       return_PTR((struct acpi_thread_state *)state);
 }
 
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_create_update_state
@@ -238,34 +215,29 @@ acpi_ut_create_thread_state (
  *
  ******************************************************************************/
 
-union acpi_generic_state *
-acpi_ut_create_update_state (
-       union acpi_operand_object       *object,
-       u16                             action)
+union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object
+                                                     *object, u16 action)
 {
-       union acpi_generic_state        *state;
-
-
-       ACPI_FUNCTION_TRACE_PTR ("ut_create_update_state", object);
+       union acpi_generic_state *state;
 
+       ACPI_FUNCTION_TRACE_PTR("ut_create_update_state", object);
 
        /* Create the generic state object */
 
-       state = acpi_ut_create_generic_state ();
+       state = acpi_ut_create_generic_state();
        if (!state) {
-               return_PTR (NULL);
+               return_PTR(NULL);
        }
 
        /* Init fields specific to the update struct */
 
        state->common.data_type = ACPI_DESC_TYPE_STATE_UPDATE;
        state->update.object = object;
-       state->update.value  = action;
+       state->update.value = action;
 
-       return_PTR (state);
+       return_PTR(state);
 }
 
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_create_pkg_state
@@ -279,37 +251,32 @@ acpi_ut_create_update_state (
  *
  ******************************************************************************/
 
-union acpi_generic_state *
-acpi_ut_create_pkg_state (
-       void                            *internal_object,
-       void                            *external_object,
-       u16                             index)
+union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object,
+                                                  void *external_object,
+                                                  u16 index)
 {
-       union acpi_generic_state        *state;
-
-
-       ACPI_FUNCTION_TRACE_PTR ("ut_create_pkg_state", internal_object);
+       union acpi_generic_state *state;
 
+       ACPI_FUNCTION_TRACE_PTR("ut_create_pkg_state", internal_object);
 
        /* Create the generic state object */
 
-       state = acpi_ut_create_generic_state ();
+       state = acpi_ut_create_generic_state();
        if (!state) {
-               return_PTR (NULL);
+               return_PTR(NULL);
        }
 
        /* Init fields specific to the update struct */
 
        state->common.data_type = ACPI_DESC_TYPE_STATE_PACKAGE;
-       state->pkg.source_object = (union acpi_operand_object *) internal_object;
-       state->pkg.dest_object  = external_object;
-       state->pkg.index        = index;
+       state->pkg.source_object = (union acpi_operand_object *)internal_object;
+       state->pkg.dest_object = external_object;
+       state->pkg.index = index;
        state->pkg.num_packages = 1;
 
-       return_PTR (state);
+       return_PTR(state);
 }
 
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_create_control_state
@@ -323,32 +290,27 @@ acpi_ut_create_pkg_state (
  *
  ******************************************************************************/
 
-union acpi_generic_state *
-acpi_ut_create_control_state (
-       void)
+union acpi_generic_state *acpi_ut_create_control_state(void)
 {
-       union acpi_generic_state        *state;
-
-
-       ACPI_FUNCTION_TRACE ("ut_create_control_state");
+       union acpi_generic_state *state;
 
+       ACPI_FUNCTION_TRACE("ut_create_control_state");
 
        /* Create the generic state object */
 
-       state = acpi_ut_create_generic_state ();
+       state = acpi_ut_create_generic_state();
        if (!state) {
-               return_PTR (NULL);
+               return_PTR(NULL);
        }
 
        /* Init fields specific to the control struct */
 
        state->common.data_type = ACPI_DESC_TYPE_STATE_CONTROL;
-       state->common.state     = ACPI_CONTROL_CONDITIONAL_EXECUTING;
+       state->common.state = ACPI_CONTROL_CONDITIONAL_EXECUTING;
 
-       return_PTR (state);
+       return_PTR(state);
 }
 
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_delete_generic_state
@@ -362,15 +324,10 @@ acpi_ut_create_control_state (
  *
  ******************************************************************************/
 
-void
-acpi_ut_delete_generic_state (
-       union acpi_generic_state        *state)
+void acpi_ut_delete_generic_state(union acpi_generic_state *state)
 {
-       ACPI_FUNCTION_TRACE ("ut_delete_generic_state");
+       ACPI_FUNCTION_TRACE("ut_delete_generic_state");
 
-
-       (void) acpi_os_release_object (acpi_gbl_state_cache, state);
+       (void)acpi_os_release_object(acpi_gbl_state_cache, state);
        return_VOID;
 }
-
-