Thread (33 messages) flat view 33 messages, 8 authors, 2016-06-15

Re: [PATCH 2/4] POWERPC: Move iommu dma ops from dma.c to dma-iommu.c

From: Becky Bruce <hidden>
Date: 2008-09-12 15:33:14

On Sep 8, 2008, at 4:57 PM, Christoph Hellwig wrote:
On Mon, Sep 08, 2008 at 02:09:53PM -0500, Becky Bruce wrote:
quoted
+/* We support DMA to/from any memory page via the iommu */
+static int dma_iommu_dma_supported(struct device *dev, u64 mask)
+{
+	struct iommu_table *tbl = dev->archdata.dma_data;
+
+	if (!tbl || tbl->it_offset > mask) {
+		printk(KERN_INFO
+		       "Warning: IOMMU offset too big for device mask\n");
+		if (tbl)
+			printk(KERN_INFO
+			       "mask: 0x%08lx, table offset: 0x%08lx\n",
+				mask, tbl->it_offset);
+		else
+			printk(KERN_INFO "mask: 0x%08lx, table unavailable\n",
+				mask);
+		return 0;
+	} else
+		return 1;
+}
Small nitpick, but wouldn't a

	if (tbl && tbl->it_offset <= mask)
		return 1;

	< the rest>

be much easier to read?
Seems cleaner to me..... but I want this patch, which is a move of the  
iommu code, to be *just* a move.  So I'm going to leave this as-is for  
now.

Thanks!
-Becky
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help