X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=drivers%2Facpi%2Fexecuter%2Fexoparg3.c;h=e2d945dfd5098b4015c652c3b36180e1020b7501;hp=483365777670d00a2100ac81de158167e7fe13b4;hb=55b4d6a52195a8f277ffddf755ddaff359878f41;hpb=0d9136fdbcdbddcd4eb5ac94c248c039193d4795 diff --git a/drivers/acpi/executer/exoparg3.c b/drivers/acpi/executer/exoparg3.c index 483365777670..e2d945dfd509 100644 --- a/drivers/acpi/executer/exoparg3.c +++ b/drivers/acpi/executer/exoparg3.c @@ -6,7 +6,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 @@ -88,20 +88,19 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state) struct acpi_signal_fatal_info *fatal; acpi_status status = AE_OK; - ACPI_FUNCTION_TRACE_STR("ex_opcode_3A_0T_0R", + ACPI_FUNCTION_TRACE_STR(ex_opcode_3A_0T_0R, acpi_ps_get_opcode_name(walk_state->opcode)); switch (walk_state->opcode) { case AML_FATAL_OP: /* Fatal (fatal_type fatal_code fatal_arg) */ ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "fatal_op: Type %X Code %X Arg %X <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n", + "FatalOp: Type %X Code %X Arg %X <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n", (u32) operand[0]->integer.value, (u32) operand[1]->integer.value, (u32) operand[2]->integer.value)); - fatal = - ACPI_MEM_ALLOCATE(sizeof(struct acpi_signal_fatal_info)); + fatal = ACPI_ALLOCATE(sizeof(struct acpi_signal_fatal_info)); if (fatal) { fatal->type = (u32) operand[0]->integer.value; fatal->code = (u32) operand[1]->integer.value; @@ -114,12 +113,13 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state) /* Might return while OS is shutting down, just continue */ - ACPI_MEM_FREE(fatal); + ACPI_FREE(fatal); break; default: - ACPI_REPORT_ERROR(("acpi_ex_opcode_3A_0T_0R: Unknown opcode %X\n", walk_state->opcode)); + ACPI_ERROR((AE_INFO, "Unknown AML opcode %X", + walk_state->opcode)); status = AE_AML_BAD_OPCODE; goto cleanup; } @@ -150,7 +150,7 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state) acpi_integer index; acpi_size length; - ACPI_FUNCTION_TRACE_STR("ex_opcode_3A_1T_1R", + ACPI_FUNCTION_TRACE_STR(ex_opcode_3A_1T_1R, acpi_ps_get_opcode_name(walk_state->opcode)); switch (walk_state->opcode) { @@ -195,7 +195,7 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state) /* Always allocate a new buffer for the String */ - buffer = ACPI_MEM_CALLOCATE((acpi_size) length + 1); + buffer = ACPI_ALLOCATE_ZEROED((acpi_size) length + 1); if (!buffer) { status = AE_NO_MEMORY; goto cleanup; @@ -207,9 +207,10 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state) /* If the requested length is zero, don't allocate a buffer */ if (length > 0) { + /* Allocate a new buffer for the Buffer */ - buffer = ACPI_MEM_CALLOCATE(length); + buffer = ACPI_ALLOCATE_ZEROED(length); if (!buffer) { status = AE_NO_MEMORY; goto cleanup; @@ -223,8 +224,9 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state) goto cleanup; } - if (length > 0) { - /* Copy the portion requested */ + if (buffer) { + + /* We have a buffer, copy the portion requested */ ACPI_MEMCPY(buffer, operand[0]->string.pointer + index, length); @@ -242,7 +244,8 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state) default: - ACPI_REPORT_ERROR(("acpi_ex_opcode_3A_0T_0R: Unknown opcode %X\n", walk_state->opcode)); + ACPI_ERROR((AE_INFO, "Unknown AML opcode %X", + walk_state->opcode)); status = AE_AML_BAD_OPCODE; goto cleanup; }