[arm-integrator:virt-to-pfn-v6.0-rc1 10/24] arch/arm/include/asm/memory.h:294:43: error: 'PAGE_SHIFT' undeclared

From: kernel test robot
Date: Thu Sep 08 2022 - 14:25:56 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git virt-to-pfn-v6.0-rc1
head: bc69ecf9b2a3d1f9699edab614580d6a6e090407
commit: dbf81f3235aaece643b3fef4b5568d79caf6db0e [10/24] ARM: mm: Make virt_to_pfn() a static inline
config: arm-defconfig (https://download.01.org/0day-ci/archive/20220909/202209090251.nxU1tPcG-lkp@xxxxxxxxx/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git/commit/?id=dbf81f3235aaece643b3fef4b5568d79caf6db0e
git remote add arm-integrator https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git
git fetch --no-tags arm-integrator virt-to-pfn-v6.0-rc1
git checkout dbf81f3235aaece643b3fef4b5568d79caf6db0e
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/gpu/drm/

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

All errors (new ones prefixed by >>):

In file included from arch/arm/include/asm/io.h:26,
from include/linux/io.h:13,
from include/linux/iosys-map.h:10,
from include/linux/dma-buf.h:16,
from drivers/gpu/drm/drm_gem_cma_helper.c:12:
arch/arm/include/asm/memory.h: In function 'virt_to_pfn':
>> arch/arm/include/asm/memory.h:294:43: error: 'PAGE_SHIFT' undeclared (first use in this function)
294 | return (((kaddr - PAGE_OFFSET) >> PAGE_SHIFT) +
| ^~~~~~~~~~
arch/arm/include/asm/memory.h:294:43: note: each undeclared identifier is reported only once for each function it appears in
arch/arm/include/asm/memory.h:296:1: error: control reaches end of non-void function [-Werror=return-type]
296 | }
| ^
cc1: some warnings being treated as errors
--
In file included from arch/arm/include/asm/io.h:26,
from include/linux/io.h:13,
from include/linux/iosys-map.h:10,
from include/linux/dma-buf.h:16,
from drivers/gpu/drm/drm_gem_shmem_helper.c:6:
arch/arm/include/asm/memory.h: In function 'virt_to_pfn':
>> arch/arm/include/asm/memory.h:294:43: error: 'PAGE_SHIFT' undeclared (first use in this function)
294 | return (((kaddr - PAGE_OFFSET) >> PAGE_SHIFT) +
| ^~~~~~~~~~
arch/arm/include/asm/memory.h:294:43: note: each undeclared identifier is reported only once for each function it appears in


vim +/PAGE_SHIFT +294 arch/arm/include/asm/memory.h

290
291 static inline unsigned long virt_to_pfn(const void *p)
292 {
293 unsigned long kaddr = (unsigned long)p;
> 294 return (((kaddr - PAGE_OFFSET) >> PAGE_SHIFT) +
295 PHYS_PFN_OFFSET);
296 }
297 #define __pa_symbol_nodebug(x) __virt_to_phys_nodebug((x))
298

--
0-DAY CI Kernel Test Service
https://01.org/lkp