summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-11-03 17:00:15 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-11-07 17:10:15 +0100
commitc947f69fff183e5d2a06160d9262b5dab7359e95 (patch)
tree717ced5b4c10d022809e3611ccd938236cef18e6
parentipw2x00: remove the right /proc/net entry (diff)
downloadlinux-c947f69fff183e5d2a06160d9262b5dab7359e95.tar.xz
linux-c947f69fff183e5d2a06160d9262b5dab7359e95.zip
ARM: Fix DMA coherent allocator alignment
An out by one bug meant that the DMA coherent allocator was aligning to one more bit than it should, causing it to run out of available memory quicker. Fix this. Reported-by: Petr Štetiar <ynezz@true.cz> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/mm/dma-mapping.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index e4dd0646e859..ac6a36142fcd 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -198,7 +198,7 @@ __dma_alloc_remap(struct page *page, size_t size, gfp_t gfp, pgprot_t prot)
* fragmentation of the DMA space, and also prevents allocations
* smaller than a section from crossing a section boundary.
*/
- bit = fls(size - 1) + 1;
+ bit = fls(size - 1);
if (bit > SECTION_SHIFT)
bit = SECTION_SHIFT;
align = 1 << bit;