Skip to content

Commit

Permalink
ARM: dma-mapping: Small logical clean up
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hiroshi Doyu authored and Marek Szyprowski committed Oct 2, 2012
1 parent bdd43cb commit 5a796ee
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions arch/arm/mm/dma-mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5a796ee

Please sign in to comment.