[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PATCH 83/88] hw/pci: use g_new() family of functions
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-trivial] [PATCH 83/88] hw/pci: use g_new() family of functions |
Date: |
Fri, 6 Oct 2017 20:50:18 -0300 |
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/pci/pci.c | 2 +-
hw/pci/pcie_port.c | 2 +-
tests/libqos/pci-pc.c | 2 +-
tests/libqos/pci.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 1e6fb88eba..32625d9fcc 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -1644,7 +1644,7 @@ static PciMemoryRegionList *qmp_query_pci_regions(const
PCIDevice *dev)
continue;
}
- region = g_malloc0(sizeof(*region));
+ region = g_new0(PciMemoryRegionList, 1);
region->value = g_malloc0(sizeof(*region->value));
if (r->type & PCI_BASE_ADDRESS_SPACE_IO) {
diff --git a/hw/pci/pcie_port.c b/hw/pci/pcie_port.c
index 6432b9ac1f..236d8bc4db 100644
--- a/hw/pci/pcie_port.c
+++ b/hw/pci/pcie_port.c
@@ -72,7 +72,7 @@ void pcie_chassis_create(uint8_t chassis_number)
if (c) {
return;
}
- c = g_malloc0(sizeof(*c));
+ c = g_new0(struct PCIEChassis, 1);
c->number = chassis_number;
QLIST_INIT(&c->slots);
QLIST_INSERT_HEAD(&chassis, c, next);
diff --git a/tests/libqos/pci-pc.c b/tests/libqos/pci-pc.c
index ded1c54c06..cde5e0a627 100644
--- a/tests/libqos/pci-pc.c
+++ b/tests/libqos/pci-pc.c
@@ -119,7 +119,7 @@ QPCIBus *qpci_init_pc(QGuestAllocator *alloc)
{
QPCIBusPC *ret;
- ret = g_malloc(sizeof(*ret));
+ ret = g_new(QPCIBusPC, 1);
ret->bus.pio_readb = qpci_pc_pio_readb;
ret->bus.pio_readw = qpci_pc_pio_readw;
diff --git a/tests/libqos/pci.c b/tests/libqos/pci.c
index 0b73cb23d0..9dd689c7b5 100644
--- a/tests/libqos/pci.c
+++ b/tests/libqos/pci.c
@@ -54,7 +54,7 @@ QPCIDevice *qpci_device_find(QPCIBus *bus, int devfn)
{
QPCIDevice *dev;
- dev = g_malloc0(sizeof(*dev));
+ dev = g_new0(QPCIDevice, 1);
dev->bus = bus;
dev->devfn = devfn;
--
2.14.2
- [Qemu-trivial] [PATCH 76/88] dma: use g_new() family of functions, (continued)
- [Qemu-trivial] [PATCH 76/88] dma: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 77/88] dump: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 78/88] gdb: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 79/88] hmp: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 80/88] numa: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 81/88] hw/acpi: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 82/88] hw/ipmi: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 83/88] hw/pci: use g_new() family of functions,
Philippe Mathieu-Daudé <=
- [Qemu-trivial] [PATCH 84/88] hw/scsi: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 85/88] hw/usb: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 86/88] net/hub: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 88/88] scripts/coverity-model: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 87/88] hw/net/rocker: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- Re: [Qemu-trivial] [PATCH 00/88] use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- Re: [Qemu-trivial] [Qemu-devel] [PATCH 00/88] use g_new() family of functions, no-reply, 2017/10/06
- Re: [Qemu-trivial] [Qemu-devel] [PATCH 00/88] use g_new() family of functions, no-reply, 2017/10/07
- Re: [Qemu-trivial] [Qemu-devel] [PATCH 00/88] use g_new() family of functions, Peter Maydell, 2017/10/07