diff options
Diffstat (limited to 'drivers/acpi/executer/exmisc.c')
-rw-r--r-- | drivers/acpi/executer/exmisc.c | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/drivers/acpi/executer/exmisc.c b/drivers/acpi/executer/exmisc.c index 00a25f8188f4..0778bff632bf 100644 --- a/drivers/acpi/executer/exmisc.c +++ b/drivers/acpi/executer/exmisc.c | |||
@@ -205,11 +205,9 @@ acpi_ex_concat_template(union acpi_operand_object *operand0, | |||
205 | ACPI_MEMCPY(new_buf, operand0->buffer.pointer, length0); | 205 | ACPI_MEMCPY(new_buf, operand0->buffer.pointer, length0); |
206 | ACPI_MEMCPY(new_buf + length0, operand1->buffer.pointer, length1); | 206 | ACPI_MEMCPY(new_buf + length0, operand1->buffer.pointer, length1); |
207 | 207 | ||
208 | /* Compute the new checksum */ | 208 | /* Set the end_tag checksum to zero, means "ignore checksum" */ |
209 | 209 | ||
210 | new_buf[return_desc->buffer.length - 1] = | 210 | new_buf[return_desc->buffer.length - 1] = 0; |
211 | acpi_ut_generate_checksum(return_desc->buffer.pointer, | ||
212 | (return_desc->buffer.length - 1)); | ||
213 | 211 | ||
214 | /* Return the completed resource template */ | 212 | /* Return the completed resource template */ |
215 | 213 | ||
@@ -242,7 +240,6 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0, | |||
242 | union acpi_operand_object *return_desc; | 240 | union acpi_operand_object *return_desc; |
243 | char *new_buf; | 241 | char *new_buf; |
244 | acpi_status status; | 242 | acpi_status status; |
245 | acpi_size new_length; | ||
246 | 243 | ||
247 | ACPI_FUNCTION_TRACE("ex_do_concatenate"); | 244 | ACPI_FUNCTION_TRACE("ex_do_concatenate"); |
248 | 245 | ||
@@ -269,7 +266,7 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0, | |||
269 | break; | 266 | break; |
270 | 267 | ||
271 | default: | 268 | default: |
272 | ACPI_REPORT_ERROR(("Concat - invalid obj type: %X\n", | 269 | ACPI_REPORT_ERROR(("Concatanate - invalid object type: %X\n", |
273 | ACPI_GET_OBJECT_TYPE(operand0))); | 270 | ACPI_GET_OBJECT_TYPE(operand0))); |
274 | status = AE_AML_INTERNAL; | 271 | status = AE_AML_INTERNAL; |
275 | } | 272 | } |
@@ -309,8 +306,7 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0, | |||
309 | 306 | ||
310 | /* Copy the first integer, LSB first */ | 307 | /* Copy the first integer, LSB first */ |
311 | 308 | ||
312 | ACPI_MEMCPY(new_buf, | 309 | ACPI_MEMCPY(new_buf, &operand0->integer.value, |
313 | &operand0->integer.value, | ||
314 | acpi_gbl_integer_byte_width); | 310 | acpi_gbl_integer_byte_width); |
315 | 311 | ||
316 | /* Copy the second integer (LSB first) after the first */ | 312 | /* Copy the second integer (LSB first) after the first */ |
@@ -324,14 +320,11 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0, | |||
324 | 320 | ||
325 | /* Result of two Strings is a String */ | 321 | /* Result of two Strings is a String */ |
326 | 322 | ||
327 | new_length = (acpi_size) operand0->string.length + | 323 | return_desc = acpi_ut_create_string_object((acpi_size) |
328 | (acpi_size) local_operand1->string.length; | 324 | (operand0->string. |
329 | if (new_length > ACPI_MAX_STRING_CONVERSION) { | 325 | length + |
330 | status = AE_AML_STRING_LIMIT; | 326 | local_operand1-> |
331 | goto cleanup; | 327 | string.length)); |
332 | } | ||
333 | |||
334 | return_desc = acpi_ut_create_string_object(new_length); | ||
335 | if (!return_desc) { | 328 | if (!return_desc) { |
336 | status = AE_NO_MEMORY; | 329 | status = AE_NO_MEMORY; |
337 | goto cleanup; | 330 | goto cleanup; |
@@ -351,11 +344,10 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0, | |||
351 | /* Result of two Buffers is a Buffer */ | 344 | /* Result of two Buffers is a Buffer */ |
352 | 345 | ||
353 | return_desc = acpi_ut_create_buffer_object((acpi_size) | 346 | return_desc = acpi_ut_create_buffer_object((acpi_size) |
354 | operand0->buffer. | 347 | (operand0->buffer. |
355 | length + | 348 | length + |
356 | (acpi_size) | 349 | local_operand1-> |
357 | local_operand1-> | 350 | buffer.length)); |
358 | buffer.length); | ||
359 | if (!return_desc) { | 351 | if (!return_desc) { |
360 | status = AE_NO_MEMORY; | 352 | status = AE_NO_MEMORY; |
361 | goto cleanup; | 353 | goto cleanup; |
@@ -365,8 +357,8 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0, | |||
365 | 357 | ||
366 | /* Concatenate the buffers */ | 358 | /* Concatenate the buffers */ |
367 | 359 | ||
368 | ACPI_MEMCPY(new_buf, | 360 | ACPI_MEMCPY(new_buf, operand0->buffer.pointer, |
369 | operand0->buffer.pointer, operand0->buffer.length); | 361 | operand0->buffer.length); |
370 | ACPI_MEMCPY(new_buf + operand0->buffer.length, | 362 | ACPI_MEMCPY(new_buf + operand0->buffer.length, |
371 | local_operand1->buffer.pointer, | 363 | local_operand1->buffer.pointer, |
372 | local_operand1->buffer.length); | 364 | local_operand1->buffer.length); |