I've tried redo series with passing alloc list as first argument,
looks ugly as hell
I tried too. Not too bad at all. See below:
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index f66da5d..820504a 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -491,14 +491,14 @@ static void acpi_set_pci_info(void)
}
}
-static void build_append_pcihp_notify_entry(AcpiAml *method, int slot)
+static void build_append_pcihp_notify_entry(AmlPool *p, AcpiAml *method, int
slot)
{
- AcpiAml if_ctx;
+ AcpiAml *if_ctx;
int32_t devfn = PCI_DEVFN(slot, 0);
- if_ctx = acpi_if(acpi_and(acpi_arg0(), acpi_int(0x1U << slot)));
- aml_append(&if_ctx, acpi_notify(acpi_name("S%.02X", devfn), acpi_arg1()));
- aml_append(method, if_ctx);
+ if_ctx = acpi_if(p, acpi_and(p, acpi_arg0(), acpi_int(p, 0x1U << slot)));
+ aml_append(p, if_ctx, acpi_notify(p, acpi_name(p, "S%.02X", devfn),
acpi_arg1(p)));
+ aml_append(p, method, if_ctx);
}
static void build_append_pci_bus_devices(AcpiAml *parent_scope, PCIBus *bus,
What exactly is the problem? A tiny bit more verbose but the lifetime
of all objects is now explicit.