mirror of
https://github.com/qemu/qemu.git
synced 2026-07-08 17:46:17 +00:00
system/ioport: minor code simplification
Drop needless memset() and replace g_malloc0() with g_new(). Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
@@ -230,9 +230,8 @@ static void portio_list_add_1(PortioList *piolist,
|
||||
mrpio = MEMORY_REGION_PORTIO_LIST(
|
||||
object_new(TYPE_MEMORY_REGION_PORTIO_LIST));
|
||||
mrpio->portio_opaque = piolist->opaque;
|
||||
mrpio->ports = g_malloc0(sizeof(MemoryRegionPortio) * (count + 1));
|
||||
mrpio->ports = g_new0(MemoryRegionPortio, count + 1);
|
||||
memcpy(mrpio->ports, pio_init, sizeof(MemoryRegionPortio) * count);
|
||||
memset(mrpio->ports + count, 0, sizeof(MemoryRegionPortio));
|
||||
|
||||
/* Adjust the offsets to all be zero-based for the region. */
|
||||
for (i = 0; i < count; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user