[PATCH] hw/loongarch: remove acpi-build.c unused variable 'aml_len'

Song Gao posted 1 patch 1 year, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220721040046.3985609-1-gaosong@loongson.cn
Maintainers: Xiaojuan Yang <yangxiaojuan@loongson.cn>, Song Gao <gaosong@loongson.cn>
hw/loongarch/acpi-build.c | 8 --------
1 file changed, 8 deletions(-)
[PATCH] hw/loongarch: remove acpi-build.c unused variable 'aml_len'
Posted by Song Gao 1 year, 9 months ago
Fix a compiler warning on openbsd:
../src/hw/loongarch/acpi-build.c:416:12: warning: variable 'aml_len'
set but not used [-Wunused-but-set-variable]
    size_t aml_len = 0;
           ^

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Song Gao <gaosong@loongson.cn>
---
 hw/loongarch/acpi-build.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/hw/loongarch/acpi-build.c b/hw/loongarch/acpi-build.c
index b95b83b079..f7f6fc9b8a 100644
--- a/hw/loongarch/acpi-build.c
+++ b/hw/loongarch/acpi-build.c
@@ -413,7 +413,6 @@ static void acpi_build(AcpiBuildTables *tables, MachineState *machine)
     AcpiFadtData fadt_data;
     unsigned facs, rsdt, fadt, dsdt;
     uint8_t *u;
-    size_t aml_len = 0;
     GArray *tables_blob = tables->table_data;
 
     init_common_fadt_data(&fadt_data);
@@ -437,12 +436,6 @@ static void acpi_build(AcpiBuildTables *tables, MachineState *machine)
     dsdt = tables_blob->len;
     build_dsdt(tables_blob, tables->linker, machine);
 
-    /*
-     * Count the size of the DSDT, we will need it for
-     * legacy sizing of ACPI tables.
-     */
-    aml_len += tables_blob->len - dsdt;
-
     /* ACPI tables pointed to by RSDT */
     fadt = tables_blob->len;
     acpi_add_table(table_offsets, tables_blob);
@@ -451,7 +444,6 @@ static void acpi_build(AcpiBuildTables *tables, MachineState *machine)
     fadt_data.xdsdt_tbl_offset = &dsdt;
     build_fadt(tables_blob, tables->linker, &fadt_data,
                lams->oem_id, lams->oem_table_id);
-    aml_len += tables_blob->len - fadt;
 
     acpi_add_table(table_offsets, tables_blob);
     build_madt(tables_blob, tables->linker, lams);
-- 
2.31.1
Re: [PATCH] hw/loongarch: remove acpi-build.c unused variable 'aml_len'
Posted by Richard Henderson 1 year, 8 months ago
On 7/20/22 21:00, Song Gao wrote:
> @@ -413,7 +413,6 @@ static void acpi_build(AcpiBuildTables *tables, MachineState *machine)
>       AcpiFadtData fadt_data;
>       unsigned facs, rsdt, fadt, dsdt;
>       uint8_t *u;
> -    size_t aml_len = 0;
...
> @@ -451,7 +444,6 @@ static void acpi_build(AcpiBuildTables *tables, MachineState *machine)
>       fadt_data.xdsdt_tbl_offset = &dsdt;
>       build_fadt(tables_blob, tables->linker, &fadt_data,
>                  lams->oem_id, lams->oem_table_id);
> -    aml_len += tables_blob->len - fadt;

This in turn removes the last use of fadt.


r~
Re: [PATCH] hw/loongarch: remove acpi-build.c unused variable 'aml_len'
Posted by Richard Henderson 1 year, 8 months ago
On 7/20/22 21:00, Song Gao wrote:
> Fix a compiler warning on openbsd:
> ../src/hw/loongarch/acpi-build.c:416:12: warning: variable 'aml_len'
> set but not used [-Wunused-but-set-variable]
>      size_t aml_len = 0;
>             ^
> 
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Song Gao <gaosong@loongson.cn>
> ---
>   hw/loongarch/acpi-build.c | 8 --------
>   1 file changed, 8 deletions(-)

Thanks, queued.


r~
Re: [PATCH] hw/loongarch: remove acpi-build.c unused variable 'aml_len'
Posted by Richard Henderson 1 year, 9 months ago
On 7/21/22 09:30, Song Gao wrote:
> Fix a compiler warning on openbsd:
> ../src/hw/loongarch/acpi-build.c:416:12: warning: variable 'aml_len'
> set but not used [-Wunused-but-set-variable]
>      size_t aml_len = 0;
>             ^
> 
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Song Gao <gaosong@loongson.cn>
> ---

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
Re: [PATCH] hw/loongarch: remove acpi-build.c unused variable 'aml_len'
Posted by gaosong 1 year, 8 months ago
Ping for 7.1

On 2022/7/24 上午11:27, Richard Henderson wrote:
> On 7/21/22 09:30, Song Gao wrote:
>> Fix a compiler warning on openbsd:
>> ../src/hw/loongarch/acpi-build.c:416:12: warning: variable 'aml_len'
>> set but not used [-Wunused-but-set-variable]
>>      size_t aml_len = 0;
>>             ^
>>
>> Reported-by: Peter Maydell <peter.maydell@linaro.org>
>> Signed-off-by: Song Gao <gaosong@loongson.cn>
>> ---
>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>
> r~