[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 1/1] vfio/pci: Remove use of g_malloc0_n() from q
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PULL 1/1] vfio/pci: Remove use of g_malloc0_n() from quirks |
Date: |
Mon, 28 Sep 2015 08:53:50 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Alex Williamson <address@hidden> writes:
> For compatibility with glib 2.22.
>
> Reported-by: Wen Congyang <address@hidden>
> Signed-off-by: Alex Williamson <address@hidden>
> ---
> hw/vfio/pci-quirks.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c
> index 2bdaef1..c675d1b 100644
> --- a/hw/vfio/pci-quirks.c
> +++ b/hw/vfio/pci-quirks.c
> @@ -284,7 +284,7 @@ static void vfio_vga_probe_ati_3c3_quirk(VFIOPCIDevice
> *vdev)
> }
>
> quirk = g_malloc0(sizeof(*quirk));
> - quirk->mem = g_malloc0_n(sizeof(MemoryRegion), 1);
> + quirk->mem = g_malloc0(sizeof(MemoryRegion));
> quirk->nr_mem = 1;
>
> memory_region_init_io(quirk->mem, OBJECT(vdev), &vfio_ati_3c3_quirk,
> vdev,
g_new0(MemoryRegion, 1) is a bit neater. Followup patch coming.
[...]