Message ID | 20190313044253.31988-3-richardw.yang@linux.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Extract build_mcfg | expand |
On Wed, 13 Mar 2019 12:42:52 +0800 Wei Yang <richardw.yang@linux.intel.com> wrote: > mcfg_start points to the start of MCFG table and is used in > build_header. While this information could be derived from mcfg. > > This patch removes the unnecessary variable mcfg_start. > > Signed-off-by: Wei Yang <richardw.yang@linux.intel.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> > --- > hw/arm/virt-acpi-build.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c > index 7713c2d809..ae7858a79a 100644 > --- a/hw/arm/virt-acpi-build.c > +++ b/hw/arm/virt-acpi-build.c > @@ -562,18 +562,15 @@ build_mcfg(GArray *table_data, BIOSLinker *linker, AcpiMcfgInfo *info) > { > AcpiTableMcfg *mcfg; > int len = sizeof(*mcfg) + sizeof(mcfg->allocation[0]); > - int mcfg_start = table_data->len; > > mcfg = acpi_data_push(table_data, len); > mcfg->allocation[0].address = cpu_to_le64(info->mcfg_base); > - > /* Only a single allocation so no need to play with segments */ > mcfg->allocation[0].pci_segment = cpu_to_le16(0); > mcfg->allocation[0].start_bus_number = 0; > mcfg->allocation[0].end_bus_number = PCIE_MMCFG_BUS(info->mcfg_size - 1); > > - build_header(linker, table_data, (void *)(table_data->data + mcfg_start), > - "MCFG", table_data->len - mcfg_start, 1, NULL, NULL); > + build_header(linker, table_data, (void *)mcfg, "MCFG", len, 1, NULL, NULL); > } > > /* GTDT */
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 7713c2d809..ae7858a79a 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -562,18 +562,15 @@ build_mcfg(GArray *table_data, BIOSLinker *linker, AcpiMcfgInfo *info) { AcpiTableMcfg *mcfg; int len = sizeof(*mcfg) + sizeof(mcfg->allocation[0]); - int mcfg_start = table_data->len; mcfg = acpi_data_push(table_data, len); mcfg->allocation[0].address = cpu_to_le64(info->mcfg_base); - /* Only a single allocation so no need to play with segments */ mcfg->allocation[0].pci_segment = cpu_to_le16(0); mcfg->allocation[0].start_bus_number = 0; mcfg->allocation[0].end_bus_number = PCIE_MMCFG_BUS(info->mcfg_size - 1); - build_header(linker, table_data, (void *)(table_data->data + mcfg_start), - "MCFG", table_data->len - mcfg_start, 1, NULL, NULL); + build_header(linker, table_data, (void *)mcfg, "MCFG", len, 1, NULL, NULL); } /* GTDT */
mcfg_start points to the start of MCFG table and is used in build_header. While this information could be derived from mcfg. This patch removes the unnecessary variable mcfg_start. Signed-off-by: Wei Yang <richardw.yang@linux.intel.com> --- hw/arm/virt-acpi-build.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)