]> git.baikalelectronics.ru Git - kernel.git/commit
RISC-V: Move all address space definition macros to one place
authorAtish Patra <atish.patra@wdc.com>
Thu, 26 Mar 2020 22:55:46 +0000 (15:55 -0700)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Fri, 27 Mar 2020 02:26:11 +0000 (19:26 -0700)
commitf2b7f56db61241bb1d791863011e105f16c06a74
tree098246a41f0c006c2a3becce087bf67e00e8747d
parent5bdcc493708f784f29cd7542ef3381aa57773464
RISC-V: Move all address space definition macros to one place

We get the following compilation error if CONFIG_SPARSEMEM_VMEMMAP is set.

---------------------------------------------------------------
./arch/riscv/include/asm/pgtable-64.h: In function ‘pud_page’:
./include/asm-generic/memory_model.h:54:29: error: ‘vmemmap’ undeclared
(first use in this function); did you mean ‘mem_map’?
 #define __pfn_to_page(pfn) (vmemmap + (pfn))
                             ^~~~~~~
./include/asm-generic/memory_model.h:82:21: note: in expansion of
macro ‘__pfn_to_page’

 #define pfn_to_page __pfn_to_page
                     ^~~~~~~~~~~~~
./arch/riscv/include/asm/pgtable-64.h:70:9: note: in expansion of macro
‘pfn_to_page’
  return pfn_to_page(pud_val(pud) >> _PAGE_PFN_SHIFT);
---------------------------------------------------------------

Fix the compliation errors by moving all the address space definition
macros before including pgtable-64.h.

Fixes: 540138b2e2b6 (riscv: Add KASAN support)
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/include/asm/pgtable.h