arch/powerpc/platforms/pseries/papr_scm.c:934:1: sparse: sparse: symbol 'dev_attr_dirty_shutdown' was not declared. Should it be static?
From: kernel test robot
Date: Tue Jul 06 2021 - 08:15:59 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 79160a603bdb51916226caf4a6616cc4e1c58a58
commit: de21e1377c4fe65bfd8d31e446482c1bc2232997 powerpc/papr_scm: Add support for reporting dirty-shutdown-count
date: 11 days ago
config: powerpc-randconfig-s031-20210706 (attached as .config)
compiler: powerpc64le-linux-gcc (GCC) 9.3.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.3-341-g8af24329-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=de21e1377c4fe65bfd8d31e446482c1bc2232997
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout de21e1377c4fe65bfd8d31e446482c1bc2232997
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=powerpc SHELL=/bin/bash arch/powerpc/platforms/pseries/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
sparse warnings: (new ones prefixed by >>)
arch/powerpc/platforms/pseries/papr_scm.c:434:69: sparse: sparse: cast to restricted __be64
arch/powerpc/platforms/pseries/papr_scm.c:437:69: sparse: sparse: cast to restricted __be32
arch/powerpc/platforms/pseries/papr_scm.c:441:69: sparse: sparse: cast to restricted __be16
arch/powerpc/platforms/pseries/papr_scm.c:476:33: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be64 [assigned] [usertype] data_be @@ got restricted __be32 [usertype] @@
arch/powerpc/platforms/pseries/papr_scm.c:476:33: sparse: expected restricted __be64 [assigned] [usertype] data_be
arch/powerpc/platforms/pseries/papr_scm.c:476:33: sparse: got restricted __be32 [usertype]
arch/powerpc/platforms/pseries/papr_scm.c:481:33: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be64 [assigned] [usertype] data_be @@ got restricted __be16 [usertype] @@
arch/powerpc/platforms/pseries/papr_scm.c:481:33: sparse: expected restricted __be64 [assigned] [usertype] data_be
arch/powerpc/platforms/pseries/papr_scm.c:481:33: sparse: got restricted __be16 [usertype]
arch/powerpc/platforms/pseries/papr_scm.c:484:33: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be64 [assigned] [usertype] data_be @@ got unsigned char [usertype] @@
arch/powerpc/platforms/pseries/papr_scm.c:484:33: sparse: expected restricted __be64 [assigned] [usertype] data_be
arch/powerpc/platforms/pseries/papr_scm.c:484:33: sparse: got unsigned char [usertype]
arch/powerpc/platforms/pseries/papr_scm.c:485:33: sparse: sparse: invalid assignment: &=
arch/powerpc/platforms/pseries/papr_scm.c:485:33: sparse: left side has type restricted __be64
arch/powerpc/platforms/pseries/papr_scm.c:485:33: sparse: right side has type int
>> arch/powerpc/platforms/pseries/papr_scm.c:934:1: sparse: sparse: symbol 'dev_attr_dirty_shutdown' was not declared. Should it be static?
vim +/dev_attr_dirty_shutdown +934 arch/powerpc/platforms/pseries/papr_scm.c
925
926 static ssize_t dirty_shutdown_show(struct device *dev,
927 struct device_attribute *attr, char *buf)
928 {
929 struct nvdimm *dimm = to_nvdimm(dev);
930 struct papr_scm_priv *p = nvdimm_provider_data(dimm);
931
932 return sysfs_emit(buf, "%llu\n", p->dirty_shutdown_counter);
933 }
> 934 DEVICE_ATTR_RO(dirty_shutdown);
935
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip