Merge git://git.infradead.org/intel-iommu
[firefly-linux-kernel-4.4.55.git] / drivers / acpi / acpica / tbinstal.c
index 9bad45e63a45401bd3f7dd4b5940c420bc63dd0b..008a251780f4c955194c7193dd943bf955028b34 100644 (file)
@@ -187,8 +187,9 @@ acpi_tb_install_fixed_table(acpi_physical_address address,
        status = acpi_tb_acquire_temp_table(&new_table_desc, address,
                                            ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL);
        if (ACPI_FAILURE(status)) {
-               ACPI_ERROR((AE_INFO, "Could not acquire table length at %p",
-                           ACPI_CAST_PTR(void, address)));
+               ACPI_ERROR((AE_INFO,
+                           "Could not acquire table length at %8.8X%8.8X",
+                           ACPI_FORMAT_UINT64(address)));
                return_ACPI_STATUS(status);
        }
 
@@ -246,8 +247,9 @@ acpi_tb_install_standard_table(acpi_physical_address address,
 
        status = acpi_tb_acquire_temp_table(&new_table_desc, address, flags);
        if (ACPI_FAILURE(status)) {
-               ACPI_ERROR((AE_INFO, "Could not acquire table length at %p",
-                           ACPI_CAST_PTR(void, address)));
+               ACPI_ERROR((AE_INFO,
+                           "Could not acquire table length at %8.8X%8.8X",
+                           ACPI_FORMAT_UINT64(address)));
                return_ACPI_STATUS(status);
        }
 
@@ -258,9 +260,10 @@ acpi_tb_install_standard_table(acpi_physical_address address,
        if (!reload &&
            acpi_gbl_disable_ssdt_table_install &&
            ACPI_COMPARE_NAME(&new_table_desc.signature, ACPI_SIG_SSDT)) {
-               ACPI_INFO((AE_INFO, "Ignoring installation of %4.4s at %p",
-                          new_table_desc.signature.ascii, ACPI_CAST_PTR(void,
-                                                                        address)));
+               ACPI_INFO((AE_INFO,
+                          "Ignoring installation of %4.4s at %8.8X%8.8X",
+                          new_table_desc.signature.ascii,
+                          ACPI_FORMAT_UINT64(address)));
                goto release_and_exit;
        }
 
@@ -346,7 +349,6 @@ acpi_tb_install_standard_table(acpi_physical_address address,
                                 */
                                acpi_tb_uninstall_table(&new_table_desc);
                                *table_index = i;
-                               (void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
                                return_ACPI_STATUS(AE_OK);
                        }
                }
@@ -354,7 +356,7 @@ acpi_tb_install_standard_table(acpi_physical_address address,
 
        /* Add the table to the global root table list */
 
-       status = acpi_tb_get_next_root_index(&i);
+       status = acpi_tb_get_next_table_descriptor(&i, NULL);
        if (ACPI_FAILURE(status)) {
                goto release_and_exit;
        }
@@ -429,11 +431,11 @@ finish_override:
                return;
        }
 
-       ACPI_INFO((AE_INFO, "%4.4s " ACPI_PRINTF_UINT
-                  " %s table override, new table: " ACPI_PRINTF_UINT,
+       ACPI_INFO((AE_INFO, "%4.4s 0x%8.8X%8.8X"
+                  " %s table override, new table: 0x%8.8X%8.8X",
                   old_table_desc->signature.ascii,
-                  ACPI_FORMAT_TO_UINT(old_table_desc->address),
-                  override_type, ACPI_FORMAT_TO_UINT(new_table_desc.address)));
+                  ACPI_FORMAT_UINT64(old_table_desc->address),
+                  override_type, ACPI_FORMAT_UINT64(new_table_desc.address)));
 
        /* We can now uninstall the original table */
 
@@ -453,43 +455,6 @@ finish_override:
        acpi_tb_release_temp_table(&new_table_desc);
 }
 
-/*******************************************************************************
- *
- * FUNCTION:    acpi_tb_store_table
- *
- * PARAMETERS:  address             - Table address
- *              table               - Table header
- *              length              - Table length
- *              flags               - Install flags
- *              table_index         - Where the table index is returned
- *
- * RETURN:      Status and table index.
- *
- * DESCRIPTION: Add an ACPI table to the global table list
- *
- ******************************************************************************/
-
-acpi_status
-acpi_tb_store_table(acpi_physical_address address,
-                   struct acpi_table_header * table,
-                   u32 length, u8 flags, u32 *table_index)
-{
-       acpi_status status;
-       struct acpi_table_desc *table_desc;
-
-       status = acpi_tb_get_next_root_index(table_index);
-       if (ACPI_FAILURE(status)) {
-               return (status);
-       }
-
-       /* Initialize added table */
-
-       table_desc = &acpi_gbl_root_table_list.tables[*table_index];
-       acpi_tb_init_table_descriptor(table_desc, address, flags, table);
-       table_desc->pointer = table;
-       return (AE_OK);
-}
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_tb_uninstall_table
@@ -517,7 +482,7 @@ void acpi_tb_uninstall_table(struct acpi_table_desc *table_desc)
 
        if ((table_desc->flags & ACPI_TABLE_ORIGIN_MASK) ==
            ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL) {
-               ACPI_FREE(ACPI_CAST_PTR(void, table_desc->address));
+               ACPI_FREE(ACPI_PHYSADDR_TO_PTR(table_desc->address));
        }
 
        table_desc->address = ACPI_PTR_TO_PHYSADDR(NULL);