]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
ACPICA: Utilities: Cleanup to enforce ACPI_PHYSADDR_TO_PTR()/ACPI_PTR_TO_PHYSADDR().
authorLv Zheng <lv.zheng@intel.com>
Mon, 13 Apr 2015 03:48:37 +0000 (11:48 +0800)
committerJiri Slaby <jslaby@suse.cz>
Wed, 20 May 2015 09:15:45 +0000 (11:15 +0200)
commit 6d3fd3cc33d50e4c0d0c0bd172de02caaec3127c upstream.

ACPICA commit 154f6d074dd38d6ebc0467ad454454e6c5c9ecdf

There are code pieces converting pointers using "(acpi_physical_address) x"
or "ACPI_CAST_PTR (t, x)" formats, this patch cleans up them.

Known issues:
1. Cleanup of "(ACPI_PHYSICAL_ADDRRESS) x" for a table field
   For the conversions around the table fields, it is better to fix it with
   alignment also fixed. So this patch doesn't modify such code. There
   should be no functional problem by leaving them unchanged.

Link: https://github.com/acpica/acpica/commit/154f6d07
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>
Signed-off-by: Dirk Behme <dirk.behme@gmail.com>
Signed-off-by: George G. Davis <george_davis@mentor.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/acpi/acpica/dsopcode.c
drivers/acpi/acpica/tbinstal.c

index 1fc1ff114f269867bf1a281e584511c00595d960..541b851a872739d5c1eaf6fc003d1934b8e0bfd1 100644 (file)
@@ -539,8 +539,7 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,
                return_ACPI_STATUS(AE_NOT_EXIST);
        }
 
-       obj_desc->region.address =
-           (acpi_physical_address) ACPI_TO_INTEGER(table);
+       obj_desc->region.address = ACPI_PTR_TO_PHYSADDR(table);
        obj_desc->region.length = table->length;
 
        ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
index 42a13c0d7015360ab44c684ab9645500fc63f1d8..52a4b8ecf4de5987db5a3f58a609c69113fe90f2 100644 (file)
@@ -300,8 +300,7 @@ struct acpi_table_header *acpi_tb_table_override(struct acpi_table_header
                        ACPI_EXCEPTION((AE_INFO, AE_NO_MEMORY,
                                        "%4.4s %p Attempted physical table override failed",
                                        table_header->signature,
-                                       ACPI_CAST_PTR(void,
-                                                     table_desc->address)));
+                                       ACPI_PHYSADDR_TO_PTR(table_desc->address)));
                        return (NULL);
                }
 
@@ -317,7 +316,7 @@ struct acpi_table_header *acpi_tb_table_override(struct acpi_table_header
        ACPI_INFO((AE_INFO,
                   "%4.4s %p %s table override, new table: %p",
                   table_header->signature,
-                  ACPI_CAST_PTR(void, table_desc->address),
+                  ACPI_PHYSADDR_TO_PTR(table_desc->address),
                   override_type, new_table));
 
        /* We can now unmap/delete the original table (if fully mapped) */