[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 18/25] fixup! acpi: simplify bios_linker API by remo
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH 18/25] fixup! acpi: simplify bios_linker API by removing redundant 'table' argument |
Date: |
Mon, 6 Jun 2016 15:18:23 +0200 |
replace glib 2.32 g_array_set_clear_func() with a manual
cleanup loop
Signed-off-by: Igor Mammedov <address@hidden>
---
hw/acpi/bios-linker-loader.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/hw/acpi/bios-linker-loader.c b/hw/acpi/bios-linker-loader.c
index a2f20ec..8e3f30d 100644
--- a/hw/acpi/bios-linker-loader.c
+++ b/hw/acpi/bios-linker-loader.c
@@ -105,12 +105,6 @@ typedef struct BiosLinkerFileEntry {
GArray *blob; /* data accosiated with @name */
} BiosLinkerFileEntry;
-static void bios_linker_free_file_entry(gpointer data)
-{
- BiosLinkerFileEntry *entry = data;
- g_free(entry->name);
-}
-
/*
* bios_linker_loader_init: allocate a new linker object instance.
*
@@ -124,15 +118,20 @@ BIOSLinker *bios_linker_loader_init(void)
linker->cmd_blob = g_array_new(false, true /* clear */, 1);
linker->file_list = g_array_new(false, true /* clear */,
sizeof(BiosLinkerFileEntry));
- g_array_set_clear_func(linker->file_list, bios_linker_free_file_entry);
return linker;
}
/* Free linker wrapper and return the linker commands array. */
void *bios_linker_loader_cleanup(BIOSLinker *linker)
{
+ int i;
+ BiosLinkerFileEntry *entry;
void *cmd_blob = g_array_free(linker->cmd_blob, false);
+ for (i = 0; i < linker->file_list->len; i++) {
+ entry = &g_array_index(linker->file_list, BiosLinkerFileEntry, i);
+ g_free(entry->name);
+ }
g_array_free(linker->file_list, true);
g_free(linker);
return cmd_blob;
--
1.8.3.1
- [Qemu-devel] [PULL 12/25] tests: acpi: update tables with consolidated legacy cpu-hotplug AML, (continued)
- [Qemu-devel] [PULL 12/25] tests: acpi: update tables with consolidated legacy cpu-hotplug AML, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 13/25] ipmi: rework the fwinfo to be fetched from the interface, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 14/25] pc: Postpone SMBIOS table installation to post machine init, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 15/25] acpi: extend ACPI interface to provide send_event hook, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 16/25] pc: use AcpiDeviceIfClass.send_event to issue GPE events, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 20/25] tpm: apci: cleanup TCPA table initialization, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 19/25] acpi: cleanup bios_linker_loader_cleanup(), Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 17/25] acpi: convert linker from GArray to BIOSLinker structure, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 23/25] pc-dimm: get memory region from ->get_memory_region(), Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 18/25] acpi: simplify bios_linker API by removing redundant 'table' argument, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PATCH 18/25] fixup! acpi: simplify bios_linker API by removing redundant 'table' argument,
Igor Mammedov <=
- [Qemu-devel] [PULL 24/25] pc-dimm: introduce realize callback, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 22/25] acpi: make bios_linker_loader_add_checksum() API offset based, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 21/25] acpi: make bios_linker_loader_add_pointer() API offset based, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 25/25] virtio: move bi-endian target support to a single location, Michael S. Tsirkin, 2016/06/05
- Re: [Qemu-devel] [PULL 00/25] pc, pci, virtio: new features, cleanups, fixes, Peter Maydell, 2016/06/06