Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53cbcbcf authored by Catalin Marinas's avatar Catalin Marinas Committed by Russell King
Browse files

ARM: 7166/1: Use PMD_SHIFT instead of PGDIR_SHIFT in dma-consistent.c



Commit 99d1717d (ARM: Add init_consistent_dma_size()) introduces dynamic
allocation of the consistent_pte array. The number of PTEs should be
calculated based on the number of PMD entries rather than PGD, hence the
PMD_SHIFT.

Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Cc: Jon Medhurst <tixy@yxit.co.uk>
Acked-by: default avatarNicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 1c8a7c1f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -168,7 +168,7 @@ static int __init consistent_init(void)
	pte_t *pte;
	int i = 0;
	unsigned long base = consistent_base;
	unsigned long num_ptes = (CONSISTENT_END - base) >> PGDIR_SHIFT;
	unsigned long num_ptes = (CONSISTENT_END - base) >> PMD_SHIFT;

	consistent_pte = kmalloc(num_ptes * sizeof(pte_t), GFP_KERNEL);
	if (!consistent_pte) {