[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PATCH 47/88] hw/i2c: use g_new() family of functions
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-trivial] [PATCH 47/88] hw/i2c: use g_new() family of functions |
Date: |
Fri, 6 Oct 2017 20:49:42 -0300 |
From: Marc-André Lureau <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>
---
hw/i2c/bitbang_i2c.c | 2 +-
hw/i2c/core.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/i2c/bitbang_i2c.c b/hw/i2c/bitbang_i2c.c
index 8be88ee265..20a9deef1a 100644
--- a/hw/i2c/bitbang_i2c.c
+++ b/hw/i2c/bitbang_i2c.c
@@ -186,7 +186,7 @@ bitbang_i2c_interface *bitbang_i2c_init(I2CBus *bus)
{
bitbang_i2c_interface *s;
- s = g_malloc0(sizeof(bitbang_i2c_interface));
+ s = g_new0(bitbang_i2c_interface, 1);
s->bus = bus;
s->last_data = 1;
diff --git a/hw/i2c/core.c b/hw/i2c/core.c
index 59068f157e..be84d6735f 100644
--- a/hw/i2c/core.c
+++ b/hw/i2c/core.c
@@ -132,7 +132,7 @@ int i2c_start_transfer(I2CBus *bus, uint8_t address, int
recv)
DeviceState *qdev = kid->child;
I2CSlave *candidate = I2C_SLAVE(qdev);
if ((candidate->address == address) || (bus->broadcast)) {
- node = g_malloc(sizeof(struct I2CNode));
+ node = g_new(struct I2CNode, 1);
node->elt = candidate;
QLIST_INSERT_HEAD(&bus->current_devs, node, next);
if (!bus->broadcast) {
@@ -258,7 +258,7 @@ static int i2c_slave_post_load(void *opaque, int version_id)
bus = I2C_BUS(qdev_get_parent_bus(DEVICE(dev)));
if ((bus->saved_address == dev->address) ||
(bus->saved_address == I2C_BROADCAST)) {
- node = g_malloc(sizeof(struct I2CNode));
+ node = g_new(struct I2CNode, 1);
node->elt = dev;
QLIST_INSERT_HEAD(&bus->current_devs, node, next);
}
--
2.14.2
- [Qemu-trivial] [PATCH 39/88] hw/i386: use g_new() family of functions, (continued)
- [Qemu-trivial] [PATCH 39/88] hw/i386: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 40/88] hw/xen: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 42/88] XTFPGA: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 41/88] target/i386: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 43/88] hw/core: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 44/88] hw/core/loader: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 45/88] hw/display: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 46/88] hw/display/vga: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 47/88] hw/i2c: use g_new() family of functions,
Philippe Mathieu-Daudé <=
- [Qemu-trivial] [PATCH 48/88] hw/input: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 49/88] hw/misc: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 50/88] ivshmem: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 51/88] hw/timer: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 52/88] i.MX31: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 53/88] iSCSI: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 54/88] KVM: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06