]> git.baikalelectronics.ru Git - kernel.git/commitdiff
riscv: fix fs/proc/kcore.c compilation with sparsemem enabled
authorDavid Abdurachmanov <david.abdurachmanov@gmail.com>
Tue, 22 Oct 2019 16:21:35 +0000 (19:21 +0300)
committerPaul Walmsley <paul.walmsley@sifive.com>
Wed, 23 Oct 2019 21:53:46 +0000 (14:53 -0700)
Failed to compile Fedora/RISCV kernel (5.4-rc3+) with sparsemem enabled:

fs/proc/kcore.c: In function 'read_kcore':
fs/proc/kcore.c:510:8: error: implicit declaration of function 'kern_addr_valid'; did you mean 'virt_addr_valid'? [-Werror=implicit-function-declaration]
  510 |    if (kern_addr_valid(start)) {
      |        ^~~~~~~~~~~~~~~
      |        virt_addr_valid

Looking at other architectures I don't see kern_addr_valid being guarded by
CONFIG_FLATMEM.

Fixes: 6926d79460ca ("RISC-V: Implement sparsemem")
Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
Tested-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
arch/riscv/include/asm/pgtable.h

index 42292d99cc740d02fb210fe92e9813bf2206cc05..7110879358b80e6c124518ccf10a4a662e099d3e 100644 (file)
@@ -428,9 +428,7 @@ static inline int ptep_clear_flush_young(struct vm_area_struct *vma,
 #define __pte_to_swp_entry(pte)        ((swp_entry_t) { pte_val(pte) })
 #define __swp_entry_to_pte(x)  ((pte_t) { (x).val })
 
-#ifdef CONFIG_FLATMEM
 #define kern_addr_valid(addr)   (1) /* FIXME */
-#endif
 
 extern void *dtb_early_va;
 extern void setup_bootmem(void);