Skip to contentSkip to conversation

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

PATCH New Catalin Marinas 3 participants 4 messages Nov 16, 2011 – Nov 17, 2011 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

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

Commit 99d1717d 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.

Cc Jon Medhurst <[email protected]>
Cc Nicolas Pitre <[email protected]>
---
 arch/arm/mm/dma-mapping.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mm/dma-mapping.c +1 -1
index e4e7f6c..ab58456 100644
@@ -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) {
#1 lore raw

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

Quoted 7 lines · Catalin Marinas

Commit 99d1717d 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.

Cc Jon Medhurst <[email protected]>
Cc Nicolas Pitre <[email protected]>
Quoted 18 lines
---
 arch/arm/mm/dma-mapping.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mm/dma-mapping.c +1 -1
index e4e7f6c..ab58456 100644
@@ -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) {
#2 lore raw

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

In reply to Catalin Marinas
Quoted 1 line · Catalin Marinas

Commit 99d1717d introduces dynamic allocation of the consistent_pte

Always include the commit summary when quoting the commit ID. Shortened commit IDs aren't guaranteed to remain unique for any amount of time, and so become ambiguous (and actually more difficult to locate when that happens.)

#3 lore raw

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

Quoted 7 lines · Russell King - ARM Linux
Quoted 1 line · Catalin Marinas

Commit 99d1717d introduces dynamic allocation of the consistent_pte

Always include the commit summary when quoting the commit ID. Shortened commit IDs aren't guaranteed to remain unique for any amount of time, and so become ambiguous (and actually more difficult to locate when that happens.)

Or at least provide more than the minimum amount of SHA1 characters to describe the commit. Something like 12 or more characters is likely to remain unambiguous for a couple decades.

Nicolas