* [PATCH] hw/arm/virt-acpi-build: Drop local iort_node_offset
@ 2024-06-19 0:17 Nicolin Chen
2024-06-19 2:41 ` Richard Henderson
2024-06-19 12:59 ` Eric Auger
0 siblings, 2 replies; 3+ messages in thread
From: Nicolin Chen @ 2024-06-19 0:17 UTC (permalink / raw)
To: peter.maydell, mst, imammedo, anisinha, shannon.zhaosl
Cc: qemu-arm, qemu-devel
Both the other two callers of build_iort_id_mapping() just directly pass
in the IORT_NODE_OFFSET macro. Keeping a "const uint32_t" local variable
storing the same value doesn't have any gain.
Simplify this by replacing the only place using this local variable with
the macro directly.
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
---
hw/arm/virt-acpi-build.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index ee6f56b410..05af407bbd 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -277,7 +277,6 @@ static void
build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
{
int i, nb_nodes, rc_mapping_count;
- const uint32_t iort_node_offset = IORT_NODE_OFFSET;
size_t node_size, smmu_offset = 0;
AcpiIortIdMapping *idmap;
uint32_t id = 0;
@@ -423,7 +422,7 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
range = &g_array_index(its_idmaps, AcpiIortIdMapping, i);
/* output IORT node is the ITS group node (the first node) */
build_iort_id_mapping(table_data, range->input_base,
- range->id_count, iort_node_offset);
+ range->id_count, IORT_NODE_OFFSET);
}
} else {
/* output IORT node is the ITS group node (the first node) */
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/arm/virt-acpi-build: Drop local iort_node_offset
2024-06-19 0:17 [PATCH] hw/arm/virt-acpi-build: Drop local iort_node_offset Nicolin Chen
@ 2024-06-19 2:41 ` Richard Henderson
2024-06-19 12:59 ` Eric Auger
1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2024-06-19 2:41 UTC (permalink / raw)
To: Nicolin Chen, peter.maydell, mst, imammedo, anisinha,
shannon.zhaosl
Cc: qemu-arm, qemu-devel
On 6/18/24 17:17, Nicolin Chen wrote:
> Both the other two callers of build_iort_id_mapping() just directly pass
> in the IORT_NODE_OFFSET macro. Keeping a "const uint32_t" local variable
> storing the same value doesn't have any gain.
>
> Simplify this by replacing the only place using this local variable with
> the macro directly.
>
> Signed-off-by: Nicolin Chen<nicolinc@nvidia.com>
> ---
> hw/arm/virt-acpi-build.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/arm/virt-acpi-build: Drop local iort_node_offset
2024-06-19 0:17 [PATCH] hw/arm/virt-acpi-build: Drop local iort_node_offset Nicolin Chen
2024-06-19 2:41 ` Richard Henderson
@ 2024-06-19 12:59 ` Eric Auger
1 sibling, 0 replies; 3+ messages in thread
From: Eric Auger @ 2024-06-19 12:59 UTC (permalink / raw)
To: Nicolin Chen, peter.maydell, mst, imammedo, anisinha,
shannon.zhaosl
Cc: qemu-arm, qemu-devel
Hi Nicolin,
On 6/19/24 02:17, Nicolin Chen wrote:
> Both the other two callers of build_iort_id_mapping() just directly pass
> in the IORT_NODE_OFFSET macro. Keeping a "const uint32_t" local variable
> storing the same value doesn't have any gain.
>
> Simplify this by replacing the only place using this local variable with
> the macro directly.
>
> Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Eric
> ---
> hw/arm/virt-acpi-build.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> index ee6f56b410..05af407bbd 100644
> --- a/hw/arm/virt-acpi-build.c
> +++ b/hw/arm/virt-acpi-build.c
> @@ -277,7 +277,6 @@ static void
> build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
> {
> int i, nb_nodes, rc_mapping_count;
> - const uint32_t iort_node_offset = IORT_NODE_OFFSET;
> size_t node_size, smmu_offset = 0;
> AcpiIortIdMapping *idmap;
> uint32_t id = 0;
> @@ -423,7 +422,7 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
> range = &g_array_index(its_idmaps, AcpiIortIdMapping, i);
> /* output IORT node is the ITS group node (the first node) */
> build_iort_id_mapping(table_data, range->input_base,
> - range->id_count, iort_node_offset);
> + range->id_count, IORT_NODE_OFFSET);
> }
> } else {
> /* output IORT node is the ITS group node (the first node) */
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-06-19 13:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-19 0:17 [PATCH] hw/arm/virt-acpi-build: Drop local iort_node_offset Nicolin Chen
2024-06-19 2:41 ` Richard Henderson
2024-06-19 12:59 ` Eric Auger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).