X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Facpi%2Futilities%2Futstate.c;h=4b134a72290711b81753003c81c30ed170386abb;hb=9464c7cf61b9433057924c36e6e02f303a00e768;hp=eaa13d05c859cd0ec20ba6543984ada6da747ff3;hpb=41689045f6a3cbe0550e1d34e9cc20d2e8c432ba;p=linux-2.6.git diff --git a/drivers/acpi/utilities/utstate.c b/drivers/acpi/utilities/utstate.c index eaa13d05c..4b134a722 100644 --- a/drivers/acpi/utilities/utstate.c +++ b/drivers/acpi/utilities/utstate.c @@ -96,7 +96,7 @@ void 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) */ @@ -123,13 +123,12 @@ union acpi_generic_state *acpi_ut_pop_generic_state(union acpi_generic_state { union acpi_generic_state *state; - ACPI_FUNCTION_TRACE(ut_pop_generic_state); + ACPI_FUNCTION_TRACE("ut_pop_generic_state"); /* Remove the state object at the head of the list (stack) */ state = *list_head; if (state) { - /* Update the list head */ *list_head = state->common.next; @@ -159,10 +158,9 @@ union acpi_generic_state *acpi_ut_create_generic_state(void) state = acpi_os_acquire_object(acpi_gbl_state_cache); if (state) { - /* Initialize */ memset(state, 0, sizeof(union acpi_generic_state)); - state->common.descriptor_type = ACPI_DESC_TYPE_STATE; + state->common.data_type = ACPI_DESC_TYPE_STATE; } return (state); @@ -185,7 +183,7 @@ struct acpi_thread_state *acpi_ut_create_thread_state(void) { union acpi_generic_state *state; - ACPI_FUNCTION_TRACE(ut_create_thread_state); + ACPI_FUNCTION_TRACE("ut_create_thread_state"); /* Create the generic state object */ @@ -196,16 +194,9 @@ struct acpi_thread_state *acpi_ut_create_thread_state(void) /* Init fields specific to the update struct */ - state->common.descriptor_type = ACPI_DESC_TYPE_STATE_THREAD; + state->common.data_type = ACPI_DESC_TYPE_STATE_THREAD; state->thread.thread_id = acpi_os_get_thread_id(); - /* Check for invalid thread ID - zero is very bad, it will break things */ - - if (!state->thread.thread_id) { - ACPI_ERROR((AE_INFO, "Invalid zero ID from AcpiOsGetThreadId")); - state->thread.thread_id = (acpi_thread_id) 1; - } - return_PTR((struct acpi_thread_state *)state); } @@ -229,7 +220,7 @@ union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object { union acpi_generic_state *state; - ACPI_FUNCTION_TRACE_PTR(ut_create_update_state, object); + ACPI_FUNCTION_TRACE_PTR("ut_create_update_state", object); /* Create the generic state object */ @@ -240,7 +231,7 @@ union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object /* Init fields specific to the update struct */ - state->common.descriptor_type = ACPI_DESC_TYPE_STATE_UPDATE; + state->common.data_type = ACPI_DESC_TYPE_STATE_UPDATE; state->update.object = object; state->update.value = action; @@ -266,7 +257,7 @@ union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object, { union acpi_generic_state *state; - ACPI_FUNCTION_TRACE_PTR(ut_create_pkg_state, internal_object); + ACPI_FUNCTION_TRACE_PTR("ut_create_pkg_state", internal_object); /* Create the generic state object */ @@ -277,7 +268,7 @@ union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object, /* Init fields specific to the update struct */ - state->common.descriptor_type = ACPI_DESC_TYPE_STATE_PACKAGE; + 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; @@ -303,7 +294,7 @@ union acpi_generic_state *acpi_ut_create_control_state(void) { union acpi_generic_state *state; - ACPI_FUNCTION_TRACE(ut_create_control_state); + ACPI_FUNCTION_TRACE("ut_create_control_state"); /* Create the generic state object */ @@ -314,7 +305,7 @@ union acpi_generic_state *acpi_ut_create_control_state(void) /* Init fields specific to the control struct */ - state->common.descriptor_type = ACPI_DESC_TYPE_STATE_CONTROL; + state->common.data_type = ACPI_DESC_TYPE_STATE_CONTROL; state->common.state = ACPI_CONTROL_CONDITIONAL_EXECUTING; return_PTR(state); @@ -328,19 +319,15 @@ union acpi_generic_state *acpi_ut_create_control_state(void) * * RETURN: None * - * DESCRIPTION: Release a state object to the state cache. NULL state objects - * are ignored. + * DESCRIPTION: Put a state object back into the global state cache. The object + * is not actually freed at this time. * ******************************************************************************/ void acpi_ut_delete_generic_state(union acpi_generic_state *state) { - ACPI_FUNCTION_TRACE(ut_delete_generic_state); - - /* Ignore null state */ + ACPI_FUNCTION_TRACE("ut_delete_generic_state"); - if (state) { - (void)acpi_os_release_object(acpi_gbl_state_cache, state); - } + (void)acpi_os_release_object(acpi_gbl_state_cache, state); return_VOID; }