Skip to contentSkip to conversation

x86: fix warning for sta2x11

PATCH New Alessandro Rubini 1 participant 1 message Feb 22, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: fix warning for sta2x11

The .free field of struct dma_map_ops features a prototype that is different from what lib/swiotlb.c offers. The new "attrs" argument in dma_ops.free is missing from the generic implementation.

This removes the build warning by providing a function that just calls swiotlb_free_coherent() without passing "attrs", like others do.

---

NOTE: The real solution, in my opinion, would be adding "attrs" as argument to the exported swiotlb_free_coherent() and remove this new empty function for sta2x11 as well as the identical empty functions found in other 6 files within arch.

If you ack, I can do that.

 arch/x86/pci/sta2x11-fixup.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
arch/x86/pci/sta2x11-fixup.c +8 -1
index 9d8a509..5c24ccb 100644
@@ -180,10 +180,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,
Signature · 1 line
1.7.7.2