]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
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, 11 Sep 2012 05:42:35 +0000 (07:42 +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 051204fc4617670321bfa5fa7c1f3621cb49a33c..17807fcb0f2d4cb9e3facf38c802c155f7cd8387 100644 (file)
@@ -1010,11 +1010,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;