hw/arm/virt-acpi-build: Drop local iort_node_offset
PATCH 1/1 hw/arm/virt-acpi-build: Drop local iort_node_offset
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.
--- hw/arm/virt-acpi-build.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
hw/arm/virt-acpi-build.c +1 -2
@@ -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) */
Signature · 1 line
2.43.0
Quoted 11 lines · Nicolin Chen
Both the other two callers of
build_iort_id_mapping()just directly pass in theIORT_NODE_OFFSETmacro. Keeping a "constuint32_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<[email protected]>--- hw/arm/virt-acpi-build.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
r~
Hi Nicolin,
Quoted 8 lines · Nicolin Chen
Both the other two callers of
build_iort_id_mapping()just directly pass in theIORT_NODE_OFFSETmacro. Keeping a "constuint32_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 <[email protected]>
Eric
Quoted 25 lines
--- hw/arm/virt-acpi-build.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)hw/arm/virt-acpi-build.c +1
-2@@ -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) */