Commit 5a796eeb authored by Hiroshi Doyu's avatar Hiroshi Doyu Committed by Marek Szyprowski

ARM: dma-mapping: Small logical clean up

Skip unnecessary operations if order == 0. A little bit easier to
read.
Signed-off-by: default avatarHiroshi Doyu <hdoyu@nvidia.com>
Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
parent bdd43cb3
...@@ -1012,11 +1012,12 @@ static struct page **__iommu_alloc_buffer(struct device *dev, size_t size, gfp_t ...@@ -1012,11 +1012,12 @@ static struct page **__iommu_alloc_buffer(struct device *dev, size_t size, gfp_t
if (!pages[i]) if (!pages[i])
goto error; goto error;
if (order) if (order) {
split_page(pages[i], order); split_page(pages[i], order);
j = 1 << order; j = 1 << order;
while (--j) while (--j)
pages[i + j] = pages[i] + j; pages[i + j] = pages[i] + j;
}
__dma_clear_buffer(pages[i], PAGE_SIZE << order); __dma_clear_buffer(pages[i], PAGE_SIZE << order);
i += 1 << order; i += 1 << order;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment