Skip to content

Commit

Permalink
ARM: 7166/1: Use PMD_SHIFT instead of PGDIR_SHIFT in dma-consistent.c
Browse files Browse the repository at this point in the history
Commit 99d1717 (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: Catalin Marinas <[email protected]>
Cc: Jon Medhurst <[email protected]>
Acked-by: Nicolas Pitre <[email protected]>
Signed-off-by: Russell King <[email protected]>
  • Loading branch information
ctmarinas authored and Russell King committed Nov 21, 2011
1 parent 1c8a7c1 commit 53cbcbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/mm/dma-mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 53cbcbc

Please sign in to comment.