All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hw/loongarch: remove acpi-build.c unused variable 'aml_len'
@ 2022-07-21  4:00 Song Gao
  2022-07-24  3:27 ` Richard Henderson
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Song Gao @ 2022-07-21  4:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: richard.henderson, peter.maydell, yangxiaojuan, gaosong

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



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] hw/loongarch: remove acpi-build.c unused variable 'aml_len'
  2022-07-21  4:00 [PATCH] hw/loongarch: remove acpi-build.c unused variable 'aml_len' Song Gao
@ 2022-07-24  3:27 ` Richard Henderson
  2022-08-05  6:52   ` gaosong
  2022-08-05 15:22 ` Richard Henderson
  2022-08-05 16:57 ` Richard Henderson
  2 siblings, 1 reply; 5+ messages in thread
From: Richard Henderson @ 2022-07-24  3:27 UTC (permalink / raw)
  To: Song Gao, qemu-devel; +Cc: peter.maydell, yangxiaojuan

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~


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] hw/loongarch: remove acpi-build.c unused variable 'aml_len'
  2022-07-24  3:27 ` Richard Henderson
@ 2022-08-05  6:52   ` gaosong
  0 siblings, 0 replies; 5+ messages in thread
From: gaosong @ 2022-08-05  6:52 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel; +Cc: peter.maydell, yangxiaojuan

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~



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] hw/loongarch: remove acpi-build.c unused variable 'aml_len'
  2022-07-21  4:00 [PATCH] hw/loongarch: remove acpi-build.c unused variable 'aml_len' Song Gao
  2022-07-24  3:27 ` Richard Henderson
@ 2022-08-05 15:22 ` Richard Henderson
  2022-08-05 16:57 ` Richard Henderson
  2 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2022-08-05 15:22 UTC (permalink / raw)
  To: Song Gao, qemu-devel; +Cc: peter.maydell, yangxiaojuan

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~


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] hw/loongarch: remove acpi-build.c unused variable 'aml_len'
  2022-07-21  4:00 [PATCH] hw/loongarch: remove acpi-build.c unused variable 'aml_len' Song Gao
  2022-07-24  3:27 ` Richard Henderson
  2022-08-05 15:22 ` Richard Henderson
@ 2022-08-05 16:57 ` Richard Henderson
  2 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2022-08-05 16:57 UTC (permalink / raw)
  To: Song Gao, qemu-devel; +Cc: peter.maydell, yangxiaojuan

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~


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-08-05 16:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-21  4:00 [PATCH] hw/loongarch: remove acpi-build.c unused variable 'aml_len' Song Gao
2022-07-24  3:27 ` Richard Henderson
2022-08-05  6:52   ` gaosong
2022-08-05 15:22 ` Richard Henderson
2022-08-05 16:57 ` Richard Henderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.