From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ShSXG-0003cd-Nm for qemu-devel@nongnu.org; Wed, 20 Jun 2012 17:33:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ShSXE-0007fQ-I8 for qemu-devel@nongnu.org; Wed, 20 Jun 2012 17:33:58 -0400 Received: from gate.crashing.org ([63.228.1.57]:53119) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ShSXE-0007f3-94 for qemu-devel@nongnu.org; Wed, 20 Jun 2012 17:33:56 -0400 Message-ID: <1340228016.28143.175.camel@pasglop> From: Benjamin Herrenschmidt Date: Thu, 21 Jun 2012 07:33:36 +1000 In-Reply-To: <4FE23DBF.9040706@codemonkey.ws> References: <1340087992-2399-1-git-send-email-benh@kernel.crashing.org> <1340087992-2399-4-git-send-email-benh@kernel.crashing.org> <4FE23DBF.9040706@codemonkey.ws> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 03/13] iommu: Add universal DMA helper functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Eduard - Gabriel Munteanu , Richard Henderson , "Michael S. Tsirkin" , qemu-devel@nongnu.org, David Gibson > > /* DMA access functions */ > > +static inline DMAContext *pci_dma_context(PCIDevice *dev) > > +{ > > + /* Stub for when we have no PCI iommu support */ > > + return NULL; > > +} > > Why is all of this stuff static inline? Why not ? Not doing so is gratuitous bloat & overhead.... > > static inline void pci_dma_sglist_init(QEMUSGList *qsg, PCIDevice *dev, > > diff --git a/qemu-common.h b/qemu-common.h > > index 8f87e41..80026af 100644 > > --- a/qemu-common.h > > +++ b/qemu-common.h > > @@ -264,6 +264,7 @@ typedef struct EventNotifier EventNotifier; > > typedef struct VirtIODevice VirtIODevice; > > typedef struct QEMUSGList QEMUSGList; > > typedef struct SHPCDevice SHPCDevice; > > +typedef struct DMAContext DMAContext; > > Please don't put this in qemu-common.h. Stick it in a dma-specific header. Hrm, the followup ISA DMA patches from Jason Baron seem to have some cleanups based on the fact that this is in qemu-common.h :-) The other typedef's in there don't seem to have any more reason to be there either to be honest. I can try to move it, I don't care much :-) dma.h sounds like the right place ? Cheers, Ben.