arch/riscv/include/asm/pgtable-64.h:64:1: warning: control reaches end of non-void function

From: kbuild test robot
Date: Tue Feb 04 2020 - 01:31:25 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d4e9056daedca3891414fe3c91de3449a5dad0f2
commit: 8ad8b72721d0f07fa02dbe71f901743f9c71c8e6 riscv: Add KASAN support
date: 12 days ago
config: riscv-randconfig-a001-20200204 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 7.5.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 8ad8b72721d0f07fa02dbe71f901743f9c71c8e6
# save the attached .config to linux build tree
GCC_VERSION=7.5.0 make.cross ARCH=riscv

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

In file included from arch/riscv/include/asm/page.h:131:0,
from arch/riscv/include/asm/thread_info.h:11,
from include/linux/thread_info.h:38,
from include/asm-generic/preempt.h:5,
from ./arch/riscv/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from include/linux/mm.h:10,
from include/linux/memblock.h:13,
from mm/kasan/init.c:14:
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:63:9: note: in expansion of macro 'pfn_to_page'
return pfn_to_page(pud_val(pud) >> _PAGE_PFN_SHIFT);
^~~~~~~~~~~
include/asm-generic/memory_model.h:54:29: note: each undeclared identifier is reported only once for each function it appears in
#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:63:9: note: in expansion of macro 'pfn_to_page'
return pfn_to_page(pud_val(pud) >> _PAGE_PFN_SHIFT);
^~~~~~~~~~~
In file included from arch/riscv/include/asm/pgtable.h:23:0,
from include/linux/mm.h:99,
from include/linux/memblock.h:13,
from mm/kasan/init.c:14:
>> arch/riscv/include/asm/pgtable-64.h:64:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^

vim +64 arch/riscv/include/asm/pgtable-64.h

60
61 static inline struct page *pud_page(pud_t pud)
62 {
63 return pfn_to_page(pud_val(pud) >> _PAGE_PFN_SHIFT);
> 64 }
65

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx Intel Corporation

Attachment: .config.gz
Description: application/gzip