vserver 1.9.5.x5
[linux-2.6.git] / drivers / acpi / executer / exstoren.c
index 6ddb1e0..e663a48 100644 (file)
@@ -7,7 +7,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2004, R. Byron Moore
+ * Copyright (C) 2000 - 2005, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -206,6 +206,7 @@ acpi_ex_store_object_to_object (
 {
        union acpi_operand_object       *actual_src_desc;
        acpi_status                     status = AE_OK;
+       acpi_object_type                original_src_type;
 
 
        ACPI_FUNCTION_TRACE_PTR ("ex_store_object_to_object", source_desc);
@@ -222,7 +223,8 @@ acpi_ex_store_object_to_object (
                return_ACPI_STATUS (status);
        }
 
-       if (ACPI_GET_OBJECT_TYPE (source_desc) != ACPI_GET_OBJECT_TYPE (dest_desc)) {
+       original_src_type = ACPI_GET_OBJECT_TYPE (source_desc);
+       if (original_src_type != ACPI_GET_OBJECT_TYPE (dest_desc)) {
                /*
                 * The source type does not match the type of the destination.
                 * Perform the "implicit conversion" of the source to the current type
@@ -232,15 +234,15 @@ acpi_ex_store_object_to_object (
                 * Otherwise, actual_src_desc is a temporary object to hold the
                 * converted object.
                 */
-               status = acpi_ex_convert_to_target_type (ACPI_GET_OBJECT_TYPE (dest_desc), source_desc,
-                                 &actual_src_desc, walk_state);
+               status = acpi_ex_convert_to_target_type (ACPI_GET_OBJECT_TYPE (dest_desc),
+                                 source_desc, &actual_src_desc, walk_state);
                if (ACPI_FAILURE (status)) {
                        return_ACPI_STATUS (status);
                }
 
                if (source_desc == actual_src_desc) {
                        /*
-                        * No conversion was performed.  Return the source_desc as the
+                        * No conversion was performed. Return the source_desc as the
                         * new object.
                         */
                        *new_desc = source_desc;
@@ -269,12 +271,18 @@ acpi_ex_store_object_to_object (
 
        case ACPI_TYPE_BUFFER:
 
-               status = acpi_ex_store_buffer_to_buffer (actual_src_desc, dest_desc);
+               /*
+                * Note: There is different store behavior depending on the original
+                * source type
+                */
+               status = acpi_ex_store_buffer_to_buffer (original_src_type, actual_src_desc,
+                                dest_desc);
                break;
 
        case ACPI_TYPE_PACKAGE:
 
-               status = acpi_ut_copy_iobject_to_iobject (actual_src_desc, &dest_desc, walk_state);
+               status = acpi_ut_copy_iobject_to_iobject (actual_src_desc, &dest_desc,
+                                walk_state);
                break;
 
        default: