From mboxrd@z Thu Jan 1 00:00:00 1970 From: Russell King - ARM Linux Subject: Re: [PATCH v8 08/19] arm/xen: get_dma_ops: return xen_dma_ops if we are running as xen_initial_domain Date: Fri, 18 Oct 2013 16:42:46 +0100 Message-ID: <20131018154246.GB25034@n2100.arm.linux.org.uk> References: <1382031814-8782-8-git-send-email-stefano.stabellini@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Stefano Stabellini Cc: xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, konrad.wilk@oracle.com, Ian.Campbell@citrix.com, will.deacon@arm.com List-Id: xen-devel@lists.xenproject.org On Fri, Oct 18, 2013 at 01:22:18PM +0100, Stefano Stabellini wrote: > Russell, > are you OK with this patch? Only concern is why the change is soo large. > > -static inline struct dma_map_ops *get_dma_ops(struct device *dev) > > +static inline struct dma_map_ops *__generic_dma_ops(struct device *dev) > > { > > if (dev && dev->archdata.dma_ops) > > return dev->archdata.dma_ops; > > return &arm_dma_ops; > > } > > > > +static inline struct dma_map_ops *get_dma_ops(struct device *dev) > > +{ > > + if (xen_initial_domain()) > > + return xen_dma_ops; > > + else > > + return __generic_dma_ops(dev); > > +} > > + What's wrong with: static inline struct dma_map_ops *get_dma_ops(struct device *dev) { + if (xen_initial_domain()) + return xen_dma_ops; if (dev && dev->archdata.dma_ops) return dev->archdata.dma_ops; return &arm_dma_ops; }