From: Hiroshi Doyu Date: Tue, 11 Sep 2012 05:39:39 +0000 (+0200) Subject: ARM: dma-mapping: Small logical clean up X-Git-Tag: upstream/snapshot3+hdmi~6555^2^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5a796eeb7bbacc628044b12a2d000167ddbabec8;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 --- diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 13f555d..c390cea 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;