public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] x86/pci: sta2x11: fix a compiler warning
@ 2012-05-23 21:28 Alessandro Rubini
  2012-05-23 23:25 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Alessandro Rubini @ 2012-05-23 21:28 UTC (permalink / raw)
  To: x86; +Cc: Giancarlo Asnaghi, linux-kernel

swiotlb_free_coherent(), exported by lib/swiotlb.b, cannot be used in
dma_ops, because it doesn't want the "attrs" argument.  Add a wrapper,
like other users of the function already do.

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
---

[V2: same patch, message fixed (sorry, I made a mess in the editor)]

Actually, we may instead add "args" to the exported functions in
lib/swiotlb.  This would then remove a few other similar wrappers that
do nothing.  If it's considered useful, I can propose a patch for that.
arch/unicore32/mm/dma-swiotlb.c is especially interesting in this
respect, because it only has the two wrappers.

 arch/x86/pci/sta2x11-fixup.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/arch/x86/pci/sta2x11-fixup.c b/arch/x86/pci/sta2x11-fixup.c
index e06334b..1ab70dc 100644
--- a/arch/x86/pci/sta2x11-fixup.c
+++ b/arch/x86/pci/sta2x11-fixup.c
@@ -181,10 +181,17 @@ static void *sta2x11_swiotlb_alloc_coherent(struct device *dev,
 	return vaddr;
 }
 
+static void sta2x11_swiotlb_free_coherent(struct device *dev, size_t size,
+					  void *vaddr, dma_addr_t dma_addr,
+					  struct dma_attrs *attrs)
+{
+	swiotlb_free_coherent(dev, size, vaddr, dma_addr);
+}
+
 /* We have our own dma_ops: the same as swiotlb but from alloc (above) */
 static struct dma_map_ops sta2x11_dma_ops = {
 	.alloc = sta2x11_swiotlb_alloc_coherent,
-	.free = swiotlb_free_coherent,
+	.free = sta2x11_swiotlb_free_coherent,
 	.map_page = swiotlb_map_page,
 	.unmap_page = swiotlb_unmap_page,
 	.map_sg = swiotlb_map_sg_attrs,
-- 
1.7.7.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH V2] x86/pci: sta2x11: fix a compiler warning
  2012-05-23 21:28 [PATCH V2] x86/pci: sta2x11: fix a compiler warning Alessandro Rubini
@ 2012-05-23 23:25 ` Thomas Gleixner
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2012-05-23 23:25 UTC (permalink / raw)
  To: Alessandro Rubini; +Cc: x86, Giancarlo Asnaghi, linux-kernel

On Wed, 23 May 2012, Alessandro Rubini wrote:

> swiotlb_free_coherent(), exported by lib/swiotlb.b, cannot be used in
> dma_ops, because it doesn't want the "attrs" argument.  Add a wrapper,
> like other users of the function already do.
> 
> Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
> Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
> ---
> 
> [V2: same patch, message fixed (sorry, I made a mess in the editor)]
> 
> Actually, we may instead add "args" to the exported functions in
> lib/swiotlb.  This would then remove a few other similar wrappers that
> do nothing.  If it's considered useful, I can propose a patch for that.

Yes please. Do nothing wrappers are harmful espcially if they get
common.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-23 23:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-23 21:28 [PATCH V2] x86/pci: sta2x11: fix a compiler warning Alessandro Rubini
2012-05-23 23:25 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox