diff mbox series

[v5,19/23] hw/i386/acpi: Remove AcpiBuildState::rsdp field

Message ID 20240529051539.71210-20-philmd@linaro.org (mailing list archive)
State New, archived
Headers show
Series hw/i386: Remove deprecated pc-i440fx-2.0 -> 2.3 machines | expand

Commit Message

Philippe Mathieu-Daudé May 29, 2024, 5:15 a.m. UTC
AcpiBuildState::rsdp is always NULL, remove it,
simplifying acpi_build_update().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
---
 hw/i386/acpi-build.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Igor Mammedov May 29, 2024, 2:51 p.m. UTC | #1
On Wed, 29 May 2024 07:15:35 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

> AcpiBuildState::rsdp is always NULL, remove it,
> simplifying acpi_build_update().
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> Reviewed-by: Zhao Liu <zhao1.liu@intel.com>

I'd squash this into previous patch 

> ---
>  hw/i386/acpi-build.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index ed0adb0e82..6f9925d176 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -2459,7 +2459,6 @@ struct AcpiBuildState {
>      MemoryRegion *table_mr;
>      /* Is table patched? */
>      uint8_t patched;
> -    void *rsdp;
>      MemoryRegion *rsdp_mr;
>      MemoryRegion *linker_mr;
>  } AcpiBuildState;
> @@ -2715,11 +2714,7 @@ static void acpi_build_update(void *build_opaque)
>  
>      acpi_ram_update(build_state->table_mr, tables.table_data);
>  
> -    if (build_state->rsdp) {
> -        memcpy(build_state->rsdp, tables.rsdp->data, acpi_data_len(tables.rsdp));
> -    } else {
> -        acpi_ram_update(build_state->rsdp_mr, tables.rsdp);
> -    }
> +    acpi_ram_update(build_state->rsdp_mr, tables.rsdp);
>  
>      acpi_ram_update(build_state->linker_mr, tables.linker->cmd_blob);
>      acpi_build_tables_cleanup(&tables, true);
> @@ -2805,7 +2800,6 @@ void acpi_setup(void)
>                             tables.vmgenid);
>      }
>  
> -    build_state->rsdp = NULL;
>      build_state->rsdp_mr = acpi_add_rom_blob(acpi_build_update,
>                                               build_state, tables.rsdp,
>                                               ACPI_BUILD_RSDP_FILE);
Igor Mammedov May 29, 2024, 3:08 p.m. UTC | #2
On Wed, 29 May 2024 07:15:35 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

> AcpiBuildState::rsdp is always NULL, remove it,
> simplifying acpi_build_update().
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> Reviewed-by: Zhao Liu <zhao1.liu@intel.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  hw/i386/acpi-build.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index ed0adb0e82..6f9925d176 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -2459,7 +2459,6 @@ struct AcpiBuildState {
>      MemoryRegion *table_mr;
>      /* Is table patched? */
>      uint8_t patched;
> -    void *rsdp;
>      MemoryRegion *rsdp_mr;
>      MemoryRegion *linker_mr;
>  } AcpiBuildState;
> @@ -2715,11 +2714,7 @@ static void acpi_build_update(void *build_opaque)
>  
>      acpi_ram_update(build_state->table_mr, tables.table_data);
>  
> -    if (build_state->rsdp) {
> -        memcpy(build_state->rsdp, tables.rsdp->data, acpi_data_len(tables.rsdp));
> -    } else {
> -        acpi_ram_update(build_state->rsdp_mr, tables.rsdp);
> -    }
> +    acpi_ram_update(build_state->rsdp_mr, tables.rsdp);
>  
>      acpi_ram_update(build_state->linker_mr, tables.linker->cmd_blob);
>      acpi_build_tables_cleanup(&tables, true);
> @@ -2805,7 +2800,6 @@ void acpi_setup(void)
>                             tables.vmgenid);
>      }
>  
> -    build_state->rsdp = NULL;
>      build_state->rsdp_mr = acpi_add_rom_blob(acpi_build_update,
>                                               build_state, tables.rsdp,
>                                               ACPI_BUILD_RSDP_FILE);
diff mbox series

Patch

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index ed0adb0e82..6f9925d176 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -2459,7 +2459,6 @@  struct AcpiBuildState {
     MemoryRegion *table_mr;
     /* Is table patched? */
     uint8_t patched;
-    void *rsdp;
     MemoryRegion *rsdp_mr;
     MemoryRegion *linker_mr;
 } AcpiBuildState;
@@ -2715,11 +2714,7 @@  static void acpi_build_update(void *build_opaque)
 
     acpi_ram_update(build_state->table_mr, tables.table_data);
 
-    if (build_state->rsdp) {
-        memcpy(build_state->rsdp, tables.rsdp->data, acpi_data_len(tables.rsdp));
-    } else {
-        acpi_ram_update(build_state->rsdp_mr, tables.rsdp);
-    }
+    acpi_ram_update(build_state->rsdp_mr, tables.rsdp);
 
     acpi_ram_update(build_state->linker_mr, tables.linker->cmd_blob);
     acpi_build_tables_cleanup(&tables, true);
@@ -2805,7 +2800,6 @@  void acpi_setup(void)
                            tables.vmgenid);
     }
 
-    build_state->rsdp = NULL;
     build_state->rsdp_mr = acpi_add_rom_blob(acpi_build_update,
                                              build_state, tables.rsdp,
                                              ACPI_BUILD_RSDP_FILE);