diff options
Diffstat (limited to 'drivers/acpi/executer/exoparg3.c')
-rw-r--r-- | drivers/acpi/executer/exoparg3.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/acpi/executer/exoparg3.c b/drivers/acpi/executer/exoparg3.c index 29d0b167745d..23b068adbf58 100644 --- a/drivers/acpi/executer/exoparg3.c +++ b/drivers/acpi/executer/exoparg3.c | |||
@@ -97,11 +97,12 @@ acpi_ex_opcode_3A_0T_0R ( | |||
97 | acpi_status status = AE_OK; | 97 | acpi_status status = AE_OK; |
98 | 98 | ||
99 | 99 | ||
100 | ACPI_FUNCTION_TRACE_STR ("ex_opcode_3A_0T_0R", acpi_ps_get_opcode_name (walk_state->opcode)); | 100 | ACPI_FUNCTION_TRACE_STR ("ex_opcode_3A_0T_0R", |
101 | acpi_ps_get_opcode_name (walk_state->opcode)); | ||
101 | 102 | ||
102 | 103 | ||
103 | switch (walk_state->opcode) { | 104 | switch (walk_state->opcode) { |
104 | case AML_FATAL_OP: /* Fatal (fatal_type fatal_code fatal_arg) */ | 105 | case AML_FATAL_OP: /* Fatal (fatal_type fatal_code fatal_arg) */ |
105 | 106 | ||
106 | ACPI_DEBUG_PRINT ((ACPI_DB_INFO, | 107 | ACPI_DEBUG_PRINT ((ACPI_DB_INFO, |
107 | "fatal_op: Type %X Code %X Arg %X <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n", | 108 | "fatal_op: Type %X Code %X Arg %X <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n", |
@@ -116,9 +117,8 @@ acpi_ex_opcode_3A_0T_0R ( | |||
116 | fatal->argument = (u32) operand[2]->integer.value; | 117 | fatal->argument = (u32) operand[2]->integer.value; |
117 | } | 118 | } |
118 | 119 | ||
119 | /* | 120 | /* Always signal the OS! */ |
120 | * Always signal the OS! | 121 | |
121 | */ | ||
122 | status = acpi_os_signal (ACPI_SIGNAL_FATAL, fatal); | 122 | status = acpi_os_signal (ACPI_SIGNAL_FATAL, fatal); |
123 | 123 | ||
124 | /* Might return while OS is shutting down, just continue */ | 124 | /* Might return while OS is shutting down, just continue */ |
@@ -162,21 +162,23 @@ acpi_ex_opcode_3A_1T_1R ( | |||
162 | union acpi_operand_object *return_desc = NULL; | 162 | union acpi_operand_object *return_desc = NULL; |
163 | char *buffer; | 163 | char *buffer; |
164 | acpi_status status = AE_OK; | 164 | acpi_status status = AE_OK; |
165 | acpi_native_uint index; | 165 | acpi_integer index; |
166 | acpi_size length; | 166 | acpi_size length; |
167 | 167 | ||
168 | 168 | ||
169 | ACPI_FUNCTION_TRACE_STR ("ex_opcode_3A_1T_1R", acpi_ps_get_opcode_name (walk_state->opcode)); | 169 | ACPI_FUNCTION_TRACE_STR ("ex_opcode_3A_1T_1R", |
170 | acpi_ps_get_opcode_name (walk_state->opcode)); | ||
170 | 171 | ||
171 | 172 | ||
172 | switch (walk_state->opcode) { | 173 | switch (walk_state->opcode) { |
173 | case AML_MID_OP: /* Mid (Source[0], Index[1], Length[2], Result[3]) */ | 174 | case AML_MID_OP: /* Mid (Source[0], Index[1], Length[2], Result[3]) */ |
174 | 175 | ||
175 | /* | 176 | /* |
176 | * Create the return object. The Source operand is guaranteed to be | 177 | * Create the return object. The Source operand is guaranteed to be |
177 | * either a String or a Buffer, so just use its type. | 178 | * either a String or a Buffer, so just use its type. |
178 | */ | 179 | */ |
179 | return_desc = acpi_ut_create_internal_object (ACPI_GET_OBJECT_TYPE (operand[0])); | 180 | return_desc = acpi_ut_create_internal_object ( |
181 | ACPI_GET_OBJECT_TYPE (operand[0])); | ||
180 | if (!return_desc) { | 182 | if (!return_desc) { |
181 | status = AE_NO_MEMORY; | 183 | status = AE_NO_MEMORY; |
182 | goto cleanup; | 184 | goto cleanup; |
@@ -184,7 +186,7 @@ acpi_ex_opcode_3A_1T_1R ( | |||
184 | 186 | ||
185 | /* Get the Integer values from the objects */ | 187 | /* Get the Integer values from the objects */ |
186 | 188 | ||
187 | index = (acpi_native_uint) operand[1]->integer.value; | 189 | index = operand[1]->integer.value; |
188 | length = (acpi_size) operand[2]->integer.value; | 190 | length = (acpi_size) operand[2]->integer.value; |
189 | 191 | ||
190 | /* | 192 | /* |
@@ -197,7 +199,8 @@ acpi_ex_opcode_3A_1T_1R ( | |||
197 | 199 | ||
198 | if ((index + length) > | 200 | if ((index + length) > |
199 | operand[0]->string.length) { | 201 | operand[0]->string.length) { |
200 | length = (acpi_size) operand[0]->string.length - index; | 202 | length = (acpi_size) operand[0]->string.length - |
203 | (acpi_size) index; | ||
201 | } | 204 | } |
202 | 205 | ||
203 | /* Allocate a new buffer for the String/Buffer */ | 206 | /* Allocate a new buffer for the String/Buffer */ |