public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
* [PATCH 1/4] ARM: dma-mapping: Small logical clean up
@ 2012-08-28 11:43 Hiroshi Doyu
  2012-08-28 11:43 ` [PATCH 2/4] ARM: dma-mapping: Remove unsed var at arm_coherent_iommu_unmap_page Hiroshi Doyu
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Hiroshi Doyu @ 2012-08-28 11:43 UTC (permalink / raw)
  To: linux-arm-kernel

Skip unnecessary operations if order == 0. A little bit easier to
read.

Signed-off-by: Hiroshi Doyu <hdoyu@nvidia•com>
---
 arch/arm/mm/dma-mapping.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 70a6275..aaea5e4 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -1032,11 +1032,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;
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-08-29  4:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-28 11:43 [PATCH 1/4] ARM: dma-mapping: Small logical clean up Hiroshi Doyu
2012-08-28 11:43 ` [PATCH 2/4] ARM: dma-mapping: Remove unsed var at arm_coherent_iommu_unmap_page Hiroshi Doyu
2012-08-28 11:43 ` [PATCH 3/4] ARM: dma-mapping: Refrain noisy console message Hiroshi Doyu
2012-08-28 11:43 ` [PATCH 4/4] ARM: dma-mapping: Skip cache maint for invalid page Hiroshi Doyu
2012-08-28 21:58   ` Marek Szyprowski
2012-08-29  4:49     ` Hiroshi Doyu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox