arch/powerpc/include/asm/book3s/64/pgtable-64k.h:60:1: error: no return statement in function returning non-void

From: kernel test robot
Date: Tue Oct 10 2023 - 07:18:21 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 94f6f0550c625fab1f373bb86a6669b45e9748b3
commit: 172aad81a882443eefe1bd860c4eddc81b14dd5b kbuild: enforce -Werror=return-type
date: 3 years ago
config: powerpc64-randconfig-003-20231009 (https://download.01.org/0day-ci/archive/20231010/202310101939.1583QpNt-lkp@xxxxxxxxx/config)
compiler: powerpc64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231010/202310101939.1583QpNt-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310101939.1583QpNt-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

In file included from arch/powerpc/include/asm/book3s/64/pgtable.h:302,
from arch/powerpc/include/asm/book3s/64/mmu-hash.h:20,
from arch/powerpc/include/asm/book3s/64/mmu.h:46,
from arch/powerpc/include/asm/mmu.h:369,
from arch/powerpc/include/asm/lppaca.h:46,
from arch/powerpc/include/asm/paca.h:17,
from arch/powerpc/include/asm/current.h:13,
from include/linux/thread_info.h:21,
from include/asm-generic/preempt.h:5,
from ./arch/powerpc/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/ipc.h:5,
from include/uapi/linux/sem.h:5,
from include/linux/sem.h:5,
from include/linux/compat.h:14,
from arch/powerpc/kernel/asm-offsets.c:14:
arch/powerpc/include/asm/book3s/64/pgtable-64k.h: In function 'get_hugepd_cache_index':
>> arch/powerpc/include/asm/book3s/64/pgtable-64k.h:60:1: error: no return statement in function returning non-void [-Werror=return-type]
60 | }
| ^
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:117: arch/powerpc/kernel/asm-offsets.s] Error 1 shuffle=1921690789
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1206: prepare0] Error 2 shuffle=1921690789
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:185: __sub-make] Error 2 shuffle=1921690789
make: Target 'prepare' not remade because of errors.


vim +60 arch/powerpc/include/asm/book3s/64/pgtable-64k.h

a9252aaefe7e72 Aneesh Kumar K.V 2016-04-29 53
fadd03c615922d Aneesh Kumar K.V 2018-06-14 54 /*
fadd03c615922d Aneesh Kumar K.V 2018-06-14 55 * This should never get called
fadd03c615922d Aneesh Kumar K.V 2018-06-14 56 */
fadd03c615922d Aneesh Kumar K.V 2018-06-14 57 static inline int get_hugepd_cache_index(int index)
fadd03c615922d Aneesh Kumar K.V 2018-06-14 58 {
fadd03c615922d Aneesh Kumar K.V 2018-06-14 59 BUG();
fadd03c615922d Aneesh Kumar K.V 2018-06-14 @60 }
fadd03c615922d Aneesh Kumar K.V 2018-06-14 61

:::::: The code at line 60 was first introduced by commit
:::::: fadd03c615922d8521a2e76d4ba2335891cb2790 powerpc/mm/hash/4k: Free hugetlb page table caches correctly.

:::::: TO: Aneesh Kumar K.V <aneesh.kumar@xxxxxxxxxxxxx>
:::::: CC: Michael Ellerman <mpe@xxxxxxxxxxxxxx>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki