ACPICA: Utilities: Cleanup to remove useless ACPI_PRINTF/FORMAT_xxx helpers.
authorLv Zheng <lv.zheng@intel.com>
Mon, 13 Apr 2015 03:48:52 +0000 (11:48 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 14 Apr 2015 12:51:51 +0000 (14:51 +0200)
ACPICA commit b60612373a4ef63b64a57c124576d7ddb6d8efb6

For physical addresses, since the address may exceed 32-bit address range
after calculation, we should use 0x%8.8X%8.8X instead of ACPI_PRINTF_UINT
and ACPI_FORMAT_UINT64() instead of
ACPI_FORMAT_NATIVE_UINT()/ACPI_FORMAT_TO_UINT().

This patch also removes above replaced macros as there are no users.

This is a preparation to switch acpi_physical_address to 64-bit on 32-bit
kernel builds.

Link: https://github.com/acpica/acpica/commit/b6061237
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpica/acmacros.h
drivers/acpi/acpica/dsopcode.c
drivers/acpi/acpica/evregion.c
drivers/acpi/acpica/exdump.c
drivers/acpi/acpica/exregion.c
drivers/acpi/acpica/nsdump.c
drivers/acpi/acpica/tbdata.c
drivers/acpi/acpica/tbinstal.c
drivers/acpi/acpica/tbprint.c

index cf607fe69dbd2274ca6bc079bf60b0af8fbbd674..c240bdf824f2679fb230680bf3f3054f344b826e 100644 (file)
 #define ACPI_SET64(ptr, val)            (*ACPI_CAST64 (ptr) = (u64) (val))
 
 /*
- * printf() format helpers. These macros are workarounds for the difficulties
+ * printf() format helper. This macros is a workaround for the difficulties
  * with emitting 64-bit integers and 64-bit pointers with the same code
  * for both 32-bit and 64-bit hosts.
  */
 #define ACPI_FORMAT_UINT64(i)           ACPI_HIDWORD(i), ACPI_LODWORD(i)
 
-#if ACPI_MACHINE_WIDTH == 64
-#define ACPI_FORMAT_NATIVE_UINT(i)      ACPI_FORMAT_UINT64(i)
-#define ACPI_FORMAT_TO_UINT(i)          ACPI_FORMAT_UINT64(i)
-#define ACPI_PRINTF_UINT                 "0x%8.8X%8.8X"
-
-#else
-#define ACPI_FORMAT_NATIVE_UINT(i)      0, (u32) (i)
-#define ACPI_FORMAT_TO_UINT(i)          (u32) (i)
-#define ACPI_PRINTF_UINT                 "0x%8.8X"
-#endif
-
 /*
  * Macros for moving data around to/from buffers that are possibly unaligned.
  * If the hardware supports the transfer of unaligned data, just do the store.
index 398e2084c35c43ab3a290ce2a9809aa37eb7b644..ea0cc4e08f8033c8acc230657d6d425a2a801510 100644 (file)
@@ -446,7 +446,7 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
 
        ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
                          obj_desc,
-                         ACPI_FORMAT_NATIVE_UINT(obj_desc->region.address),
+                         ACPI_FORMAT_UINT64(obj_desc->region.address),
                          obj_desc->region.length));
 
        /* Now the address and length are valid for this opregion */
@@ -544,7 +544,7 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,
 
        ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
                          obj_desc,
-                         ACPI_FORMAT_NATIVE_UINT(obj_desc->region.address),
+                         ACPI_FORMAT_UINT64(obj_desc->region.address),
                          obj_desc->region.length));
 
        /* Now the address and length are valid for this opregion */
index 9abace3401f9a00891a3e6851ee81001a404aea0..2ba28a63fb68527608eb54bb1d37c494ce890c85 100644 (file)
@@ -272,7 +272,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
        ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,
                          "Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
                          &region_obj->region.handler->address_space, handler,
-                         ACPI_FORMAT_NATIVE_UINT(address),
+                         ACPI_FORMAT_UINT64(address),
                          acpi_ut_get_region_name(region_obj->region.
                                                  space_id)));
 
index 7c213b6b64723c92a2954472c4e57f0d61ed8ecd..1da52bef632e1a6b28f343f78ae6277c083f7792 100644 (file)
@@ -767,8 +767,8 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
                        acpi_os_printf("\n");
                } else {
                        acpi_os_printf(" base %8.8X%8.8X Length %X\n",
-                                      ACPI_FORMAT_NATIVE_UINT(obj_desc->region.
-                                                              address),
+                                      ACPI_FORMAT_UINT64(obj_desc->region.
+                                                         address),
                                       obj_desc->region.length);
                }
                break;
index 2b8cae62529ae67b9fa7515a01731c59d32fe5f4..389a4121b2820d612262dea83982999f1fc6f5dc 100644 (file)
@@ -182,7 +182,7 @@ acpi_ex_system_memory_space_handler(u32 function,
                if (!mem_info->mapped_logical_address) {
                        ACPI_ERROR((AE_INFO,
                                    "Could not map memory at 0x%8.8X%8.8X, size %u",
-                                   ACPI_FORMAT_NATIVE_UINT(address),
+                                   ACPI_FORMAT_UINT64(address),
                                    (u32)map_length));
                        mem_info->mapped_length = 0;
                        return_ACPI_STATUS(AE_NO_MEMORY);
@@ -203,8 +203,7 @@ acpi_ex_system_memory_space_handler(u32 function,
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                          "System-Memory (width %u) R/W %u Address=%8.8X%8.8X\n",
-                         bit_width, function,
-                         ACPI_FORMAT_NATIVE_UINT(address)));
+                         bit_width, function, ACPI_FORMAT_UINT64(address)));
 
        /*
         * Perform the memory read or write
@@ -319,8 +318,7 @@ acpi_ex_system_io_space_handler(u32 function,
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                          "System-IO (width %u) R/W %u Address=%8.8X%8.8X\n",
-                         bit_width, function,
-                         ACPI_FORMAT_NATIVE_UINT(address)));
+                         bit_width, function, ACPI_FORMAT_UINT64(address)));
 
        /* Decode the function parameter */
 
index e76d8fda24a57cebc022d06e846dfd86fc9dcc6a..d259393505fa9bb9230ef51a152a01c317c5350c 100644 (file)
@@ -346,8 +346,9 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
                                                               space_id));
                        if (obj_desc->region.flags & AOPOBJ_DATA_VALID) {
                                acpi_os_printf(" Addr %8.8X%8.8X Len %.4X\n",
-                                              ACPI_FORMAT_NATIVE_UINT
-                                              (obj_desc->region.address),
+                                              ACPI_FORMAT_UINT64(obj_desc->
+                                                                 region.
+                                                                 address),
                                               obj_desc->region.length);
                        } else {
                                acpi_os_printf
index 03834496d55bdde3d2941e6ca61422fc1e525615..fd5998b2b46b7277e20b6fbd7a7f1d5d47f866e0 100644 (file)
@@ -399,14 +399,14 @@ acpi_tb_verify_temp_table(struct acpi_table_desc * table_desc, char *signature)
                                            table_desc->length);
                if (ACPI_FAILURE(status)) {
                        ACPI_EXCEPTION((AE_INFO, AE_NO_MEMORY,
-                                       "%4.4s " ACPI_PRINTF_UINT
+                                       "%4.4s 0x%8.8X%8.8X"
                                        " Attempted table install failed",
                                        acpi_ut_valid_acpi_name(table_desc->
                                                                signature.
                                                                ascii) ?
                                        table_desc->signature.ascii : "????",
-                                       ACPI_FORMAT_TO_UINT(table_desc->
-                                                           address)));
+                                       ACPI_FORMAT_UINT64(table_desc->
+                                                          address)));
                        goto invalidate_and_exit;
                }
        }
index 65da4c0f13e610cfa8d3e6cff4ce2b774afaecb7..0d184c4344e6d1a522069097761a510e2992fbd0 100644 (file)
@@ -432,11 +432,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 */
 
index ef16c06e5091f0eb5dec9b00bcc9ec7a262f46a6..77ba5c71c6e787e88a7f7923e44e1bc3adfeb7ca 100644 (file)
@@ -127,18 +127,12 @@ acpi_tb_print_table_header(acpi_physical_address address,
 {
        struct acpi_table_header local_header;
 
-       /*
-        * The reason that we use ACPI_PRINTF_UINT and ACPI_FORMAT_TO_UINT is to
-        * support both 32-bit and 64-bit hosts/addresses in a consistent manner.
-        * The %p specifier does not emit uniform output on all hosts. On some,
-        * leading zeros are not supported.
-        */
        if (ACPI_COMPARE_NAME(header->signature, ACPI_SIG_FACS)) {
 
                /* FACS only has signature and length fields */
 
-               ACPI_INFO((AE_INFO, "%-4.4s " ACPI_PRINTF_UINT " %06X",
-                          header->signature, ACPI_FORMAT_TO_UINT(address),
+               ACPI_INFO((AE_INFO, "%-4.4s 0x%8.8X%8.8X %06X",
+                          header->signature, ACPI_FORMAT_UINT64(address),
                           header->length));
        } else if (ACPI_VALIDATE_RSDP_SIG(header->signature)) {
 
@@ -149,9 +143,8 @@ acpi_tb_print_table_header(acpi_physical_address address,
                                          header)->oem_id, ACPI_OEM_ID_SIZE);
                acpi_tb_fix_string(local_header.oem_id, ACPI_OEM_ID_SIZE);
 
-               ACPI_INFO((AE_INFO,
-                          "RSDP " ACPI_PRINTF_UINT " %06X (v%.2d %-6.6s)",
-                          ACPI_FORMAT_TO_UINT(address),
+               ACPI_INFO((AE_INFO, "RSDP 0x%8.8X%8.8X %06X (v%.2d %-6.6s)",
+                          ACPI_FORMAT_UINT64(address),
                           (ACPI_CAST_PTR(struct acpi_table_rsdp, header)->
                            revision >
                            0) ? ACPI_CAST_PTR(struct acpi_table_rsdp,
@@ -165,9 +158,9 @@ acpi_tb_print_table_header(acpi_physical_address address,
                acpi_tb_cleanup_table_header(&local_header, header);
 
                ACPI_INFO((AE_INFO,
-                          "%-4.4s " ACPI_PRINTF_UINT
+                          "%-4.4s 0x%8.8X%8.8X"
                           " %06X (v%.2d %-6.6s %-8.8s %08X %-4.4s %08X)",
-                          local_header.signature, ACPI_FORMAT_TO_UINT(address),
+                          local_header.signature, ACPI_FORMAT_UINT64(address),
                           local_header.length, local_header.revision,
                           local_header.oem_id, local_header.oem_table_id,
                           local_header.oem_revision,