From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: Re: [RFC PATCH 1/5] vfio/quirks: Add common quirk alloc helper Date: Thu, 8 Feb 2018 11:28:36 -0700 Message-ID: <20180208112836.072766e3@w520.home> References: <20180207001615.1156.10547.stgit@gimli.home> <20180207002615.1156.74568.stgit@gimli.home> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org To: Auger Eric Return-path: Received: from mx1.redhat.com ([209.132.183.28]:58298 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751848AbeBHS2o (ORCPT ); Thu, 8 Feb 2018 13:28:44 -0500 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Thu, 8 Feb 2018 12:10:35 +0100 Auger Eric wrote: > Hi Alex, > On 07/02/18 01:26, Alex Williamson wrote: > > This will later be used to include list initialization > > > > Signed-off-by: Alex Williamson > > --- > > hw/vfio/pci-quirks.c | 48 +++++++++++++++++++++--------------------------- > > 1 file changed, 21 insertions(+), 27 deletions(-) > > > > diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c > > index e5779a7ad35b..10af23217292 100644 > > --- a/hw/vfio/pci-quirks.c > > +++ b/hw/vfio/pci-quirks.c > > @@ -275,6 +275,15 @@ static const MemoryRegionOps vfio_ati_3c3_quirk = { > > .endianness = DEVICE_LITTLE_ENDIAN, > > }; > > > > +static VFIOQuirk *vfio_quirk_alloc(int nr_mem) > > +{ > > + VFIOQuirk *quirk = g_malloc0(sizeof(*quirk)); > nit: Peter advised the usage of g_new0 as well for that kind of alloc. Not my favorite interface, but good point. Updated and R-b added. Thanks, Alex