[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/23] hw/ppc/ppc405_boards: Initialize g_autofree pointer
From: |
Daniel Henrique Barboza |
Subject: |
[PULL 18/23] hw/ppc/ppc405_boards: Initialize g_autofree pointer |
Date: |
Wed, 20 Apr 2022 19:13:24 -0300 |
From: Bernhard Beschow <shentey@gmail.com>
Resolves the only compiler warning when building a full QEMU under Arch Linux:
Compiling C object libqemu-ppc-softmmu.fa.p/hw_ppc_ppc405_boards.c.o
In file included from /usr/include/glib-2.0/glib.h:114,
from qemu/include/glib-compat.h:32,
from qemu/include/qemu/osdep.h:132,
from ../src/hw/ppc/ppc405_boards.c:25:
../src/hw/ppc/ppc405_boards.c: In function ‘ref405ep_init’:
/usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: warning: ‘filename’ may
be used uninitialized in this function [-Wmaybe-uninitialized]
28 | g_free (*pp);
| ^~~~~~~~~~~~
../src/hw/ppc/ppc405_boards.c:265:26: note: ‘filename’ was declared here
265 | g_autofree char *filename;
| ^~~~~~~~
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20220405123534.3395-1-shentey@gmail.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
hw/ppc/ppc405_boards.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
index 32013b8983..a66ad05e3a 100644
--- a/hw/ppc/ppc405_boards.c
+++ b/hw/ppc/ppc405_boards.c
@@ -261,13 +261,13 @@ static void ref405ep_init(MachineState *machine)
/* allocate and load BIOS */
if (machine->firmware) {
MemoryRegion *bios = g_new(MemoryRegion, 1);
- g_autofree char *filename;
+ g_autofree char *filename = qemu_find_file(QEMU_FILE_TYPE_BIOS,
+ machine->firmware);
long bios_size;
memory_region_init_rom(bios, NULL, "ef405ep.bios", BIOS_SIZE,
&error_fatal);
- filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, machine->firmware);
if (!filename) {
error_report("Could not find firmware '%s'", machine->firmware);
exit(1);
--
2.35.1
- [PULL 08/23] spapr: Move hypercall_register_softmmu, (continued)
- [PULL 08/23] spapr: Move hypercall_register_softmmu, Daniel Henrique Barboza, 2022/04/20
- [PULL 09/23] spapr: Move nested KVM hypercalls under a TCG only config., Daniel Henrique Barboza, 2022/04/20
- [PULL 10/23] target/ppc: Improve KVM hypercall trace, Daniel Henrique Barboza, 2022/04/20
- [PULL 11/23] qemu/int128: add int128_urshift, Daniel Henrique Barboza, 2022/04/20
- [PULL 12/23] softfloat: add uint128_to_float128, Daniel Henrique Barboza, 2022/04/20
- [PULL 13/23] softfloat: add int128_to_float128, Daniel Henrique Barboza, 2022/04/20
- [PULL 14/23] softfloat: add float128_to_uint128, Daniel Henrique Barboza, 2022/04/20
- [PULL 15/23] softfloat: add float128_to_int128, Daniel Henrique Barboza, 2022/04/20
- [PULL 16/23] target/ppc: implement xscv[su]qqp, Daniel Henrique Barboza, 2022/04/20
- [PULL 17/23] target/ppc: implement xscvqp[su]qz, Daniel Henrique Barboza, 2022/04/20
- [PULL 18/23] hw/ppc/ppc405_boards: Initialize g_autofree pointer,
Daniel Henrique Barboza <=
- [PULL 19/23] ppc/vof: Fix uninitialized string tracing, Daniel Henrique Barboza, 2022/04/20
- [PULL 20/23] pcie: Don't try triggering a LSI when not defined, Daniel Henrique Barboza, 2022/04/20
- [PULL 21/23] ppc/pnv: Remove LSI on the PCIE host bridge, Daniel Henrique Barboza, 2022/04/20
- [PULL 22/23] target/ppc: Add two missing register callbacks on POWER10, Daniel Henrique Barboza, 2022/04/20
- [PULL 23/23] hw/ppc: change indentation to spaces from TABs, Daniel Henrique Barboza, 2022/04/20
- Re: [PULL 00/23] ppc queue, Richard Henderson, 2022/04/21