ARM: dma-mapping: Small logical clean up
authorHiroshi Doyu <hdoyu@nvidia.com>
Tue, 11 Sep 2012 05:39:39 +0000 (07:39 +0200)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Tue, 2 Oct 2012 06:57:45 +0000 (08:57 +0200)
Skip unnecessary operations if order == 0. A little bit easier to
read.

Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
arch/arm/mm/dma-mapping.c

index 13f555d62491e59fbae0127f89e3f2b2395d3abf..c390cea6a2584bd55bf571c71757088984a6467d 100644 (file)
@@ -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;