From 5a796eeb7bbacc628044b12a2d000167ddbabec8 Mon Sep 17 00:00:00 2001 From: Hiroshi Doyu Date: Tue, 11 Sep 2012 07:39:39 +0200 Subject: ARM: dma-mapping: Small logical clean up Skip unnecessary operations if order == 0. A little bit easier to read. Signed-off-by: Hiroshi Doyu Signed-off-by: Marek Szyprowski --- arch/arm/mm/dma-mapping.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'arch') diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 13f555d6249..c390cea6a25 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -1012,11 +1012,12 @@ static struct page **__iommu_alloc_buffer(struct device *dev, size_t size, gfp_t if (!pages[i]) goto error; - if (order) + if (order) { split_page(pages[i], order); - j = 1 << order; - while (--j) - pages[i + j] = pages[i] + j; + j = 1 << order; + while (--j) + pages[i + j] = pages[i] + j; + } __dma_clear_buffer(pages[i], PAGE_SIZE << order); i += 1 << order; -- cgit v1.2.3 From 75c5971614932ca53009cbbdfd6c8f96eab9e46f Mon Sep 17 00:00:00 2001 From: Hiroshi Doyu Date: Tue, 11 Sep 2012 07:39:48 +0200 Subject: ARM: dma-mapping: Refrain noisy console message With many IOMMU'able devices, console gets noisy. Tegra30 has a few dozen of IOMMU'able devices. Signed-off-by: Hiroshi Doyu Signed-off-by: Marek Szyprowski --- arch/arm/mm/dma-mapping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index c390cea6a25..3819f029a40 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -1666,7 +1666,7 @@ int arm_iommu_attach_device(struct device *dev, dev->archdata.mapping = mapping; set_dma_ops(dev, &iommu_ops); - pr_info("Attached IOMMU controller to %s device.\n", dev_name(dev)); + pr_debug("Attached IOMMU controller to %s device.\n", dev_name(dev)); return 0; } -- cgit v1.2.3