ARM: Use PMD_SHIFT instead of PGDIR_SHIFT in dma-consistent.c
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.
--- arch/arm/mm/dma-mapping.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mm/dma-mapping.c +1 -1
@@ -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) {
PATCH 1/1 ARM: Use PMD_SHIFT instead of PGDIR_SHIFT in dma-consistent.c
Quoted 7 lines · Catalin Marinas
Commit
99d1717dintroduces dynamic allocation of theconsistent_ptearray. The number of PTEs should be calculated based on the number of PMD entries rather than PGD, hence thePMD_SHIFT.Signed-off-by Catalin Marinas <[email protected]>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@@ -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) {
PATCH 1/1 ARM: Use PMD_SHIFT instead of PGDIR_SHIFT in dma-consistent.c
In reply to Catalin MarinasQuoted 1 line · Catalin Marinas
Commit
99d1717dintroduces dynamic allocation of theconsistent_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.)
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
99d1717dintroduces dynamic allocation of theconsistent_pteAlways 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