From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5wjB-0006EW-CQ for qemu-devel@nongnu.org; Fri, 09 Mar 2012 05:07:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5wj6-0002wS-OM for qemu-devel@nongnu.org; Fri, 09 Mar 2012 05:07:12 -0500 Received: from mail-iy0-f173.google.com ([209.85.210.173]:44018) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5wj6-0002wH-GV for qemu-devel@nongnu.org; Fri, 09 Mar 2012 05:07:08 -0500 Received: by iafj26 with SMTP id j26so2141935iaf.4 for ; Fri, 09 Mar 2012 02:07:06 -0800 (PST) Sender: Paolo Bonzini Message-ID: <4F59D631.3050702@redhat.com> Date: Fri, 09 Mar 2012 11:06:41 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1331269308-22372-1-git-send-email-david@gibson.dropbear.id.au> <1331269308-22372-6-git-send-email-david@gibson.dropbear.id.au> In-Reply-To: <1331269308-22372-6-git-send-email-david@gibson.dropbear.id.au> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 05/13] iommu: Add universal DMA helper functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: mst@redhat.com, Joerg Rodel , agraf@suse.de, qemu-devel@nongnu.org, eduard.munteanu@linux360.ro, rth@twiddle.net Il 09/03/2012 06:01, David Gibson ha scritto: > +static inline int dma_memory_read(DMAContext *dma, dma_addr_t addr, > + void *buf, dma_addr_t len) > +{ > + return dma_memory_rw(dma, addr, buf, len, DMA_DIRECTION_TO_DEVICE); > +} > + > +static inline int dma_memory_write(DMAContext *dma, dma_addr_t addr, > + const void *buf, dma_addr_t len) > +{ > + return dma_memory_rw(dma, addr, (void *)buf, len, > + DMA_DIRECTION_FROM_DEVICE); > +} This is opposite to the convention of dma_buf_read/dma_buf_write, which is from the point of view of the device. Either way is okay for me, including removing dma_buf_read/dma_buf_write altogether and using dma_buf_rw in the few users (so that there will be an explicit DMADirection argument that clears all confusion). Paolo