Re: arch/riscv/kernel/cpufeature.c:34:1: sparse: sparse: symbol '__pcpu_scope_misaligned_access_speed' was not declared. Should it be static?

From: Evan Green
Date: Tue May 02 2023 - 11:43:32 EST


Conor, this one was fixed by your patch to include cpufeature.h in
cpufeature.c, right?
-Evan

On Mon, May 1, 2023 at 11:50 PM kernel test robot <lkp@xxxxxxxxx> wrote:
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 865fdb08197e657c59e74a35fa32362b12397f58
> commit: 62a31d6e38bd0faef7c956b358d651f7bdc4ae0c RISC-V: hwprobe: Support probing of misaligned access performance
> date: 13 days ago
> config: riscv-randconfig-s052-20230430 (https://download.01.org/0day-ci/archive/20230502/202305021414.EuPdM9kv-lkp@xxxxxxxxx/config)
> compiler: riscv64-linux-gcc (GCC) 12.1.0
> reproduce:
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # apt-get install sparse
> # sparse version: v0.6.4-39-gce1a6720-dirty
> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=62a31d6e38bd0faef7c956b358d651f7bdc4ae0c
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout 62a31d6e38bd0faef7c956b358d651f7bdc4ae0c
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=riscv olddefconfig
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=riscv SHELL=/bin/bash arch/riscv/kernel/
>
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Link: https://lore.kernel.org/oe-kbuild-all/202305021414.EuPdM9kv-lkp@xxxxxxxxx/
>
> sparse warnings: (new ones prefixed by >>)
> WARNING: invalid argument to '-march': '_zihintpause'
> >> arch/riscv/kernel/cpufeature.c:34:1: sparse: sparse: symbol '__pcpu_scope_misaligned_access_speed' was not declared. Should it be static?
>
> vim +/__pcpu_scope_misaligned_access_speed +34 arch/riscv/kernel/cpufeature.c
>
> 30
> 31 /**
> 32 * riscv_isa_extension_base() - Get base extension word
> 33 *
> > 34 * @isa_bitmap: ISA bitmap to use
> 35 * Return: base extension word as unsigned long value
> 36 *
> 37 * NOTE: If isa_bitmap is NULL then Host ISA bitmap will be used.
> 38 */
> 39 unsigned long riscv_isa_extension_base(const unsigned long *isa_bitmap)
> 40 {
> 41 if (!isa_bitmap)
> 42 return riscv_isa[0];
> 43 return isa_bitmap[0];
> 44 }
> 45 EXPORT_SYMBOL_GPL(riscv_isa_extension_base);
> 46
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests