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

Christoph Hellwig hch at lst.de
Tue Sep 9 07:57:50 EST 2008


On Mon, Sep 08, 2008 at 02:09:53PM -0500, Becky Bruce wrote:
> +/* 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?




More information about the Linuxppc-dev mailing list