[linux-nvme:nvme-6.5 26/26] drivers/nvme/host/core.c:2999:41: error: incompatible integer to pointer conversion passing 'unsigned long' to parameter of type 'const volatile unsigned long *'; take the address with &
kernel test robot
lkp at intel.com
Mon Jun 12 17:17:20 PDT 2023
tree: git://git.infradead.org/nvme.git nvme-6.5
head: 9aa77a0506d6990714c9fbb1c03596cd8e1094c7
commit: 9aa77a0506d6990714c9fbb1c03596cd8e1094c7 [26/26] nvme: skip optional id ctrl csi if it failed
config: i386-randconfig-i002-20230612 (https://download.01.org/0day-ci/archive/20230613/202306130839.SgF584xI-lkp@intel.com/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project.git 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce (this is a W=1 build):
mkdir -p ~/bin
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git remote add linux-nvme git://git.infradead.org/nvme.git
git fetch --no-tags linux-nvme nvme-6.5
git checkout 9aa77a0506d6990714c9fbb1c03596cd8e1094c7
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=i386 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/nvme/
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 at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306130839.SgF584xI-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/nvme/host/core.c:2999:41: error: incompatible integer to pointer conversion passing 'unsigned long' to parameter of type 'const volatile unsigned long *'; take the address with & [-Wint-conversion]
test_bit(NVME_CTRL_SKIP_ID_CNS_CS, ctrl->flags))
^~~~~~~~~~~
&
include/linux/bitops.h:61:50: note: expanded from macro 'test_bit'
#define test_bit(nr, addr) bitop(_test_bit, nr, addr)
^~~~
include/linux/bitops.h:53:17: note: expanded from macro 'bitop'
const##op(nr, addr) : op(nr, addr))
^~~~
include/asm-generic/bitops/generic-non-atomic.h:166:64: note: passing argument to parameter 'addr' here
const_test_bit(unsigned long nr, const volatile unsigned long *addr)
^
>> drivers/nvme/host/core.c:2999:41: error: incompatible integer to pointer conversion passing 'unsigned long' to parameter of type 'const volatile unsigned long *'; take the address with & [-Wint-conversion]
test_bit(NVME_CTRL_SKIP_ID_CNS_CS, ctrl->flags))
^~~~~~~~~~~
&
include/linux/bitops.h:61:50: note: expanded from macro 'test_bit'
#define test_bit(nr, addr) bitop(_test_bit, nr, addr)
^~~~
include/linux/bitops.h:53:32: note: expanded from macro 'bitop'
const##op(nr, addr) : op(nr, addr))
^~~~
include/asm-generic/bitops/instrumented-non-atomic.h:139:59: note: passing argument to parameter 'addr' here
_test_bit(unsigned long nr, const volatile unsigned long *addr)
^
>> drivers/nvme/host/core.c:3022:37: error: incompatible integer to pointer conversion passing 'unsigned long' to parameter of type 'volatile unsigned long *'; take the address with & [-Wint-conversion]
set_bit(NVME_CTRL_SKIP_ID_CNS_CS, ctrl->flags);
^~~~~~~~~~~
&
include/asm-generic/bitops/instrumented-atomic.h:26:70: note: passing argument to parameter 'addr' here
static __always_inline void set_bit(long nr, volatile unsigned long *addr)
^
3 errors generated.
vim +2999 drivers/nvme/host/core.c
2970
2971 static int nvme_init_non_mdts_limits(struct nvme_ctrl *ctrl)
2972 {
2973 struct nvme_command c = { };
2974 struct nvme_id_ctrl_nvm *id;
2975 int ret;
2976
2977 if (ctrl->oncs & NVME_CTRL_ONCS_DSM) {
2978 ctrl->max_discard_sectors = UINT_MAX;
2979 ctrl->max_discard_segments = NVME_DSM_MAX_RANGES;
2980 } else {
2981 ctrl->max_discard_sectors = 0;
2982 ctrl->max_discard_segments = 0;
2983 }
2984
2985 /*
2986 * Even though NVMe spec explicitly states that MDTS is not applicable
2987 * to the write-zeroes, we are cautious and limit the size to the
2988 * controllers max_hw_sectors value, which is based on the MDTS field
2989 * and possibly other limiting factors.
2990 */
2991 if ((ctrl->oncs & NVME_CTRL_ONCS_WRITE_ZEROES) &&
2992 !(ctrl->quirks & NVME_QUIRK_DISABLE_WRITE_ZEROES))
2993 ctrl->max_zeroes_sectors = ctrl->max_hw_sectors;
2994 else
2995 ctrl->max_zeroes_sectors = 0;
2996
2997 if (ctrl->subsys->subtype != NVME_NQN_NVME ||
2998 nvme_ctrl_limited_cns(ctrl) ||
> 2999 test_bit(NVME_CTRL_SKIP_ID_CNS_CS, ctrl->flags))
3000 return 0;
3001
3002 id = kzalloc(sizeof(*id), GFP_KERNEL);
3003 if (!id)
3004 return -ENOMEM;
3005
3006 c.identify.opcode = nvme_admin_identify;
3007 c.identify.cns = NVME_ID_CNS_CS_CTRL;
3008 c.identify.csi = NVME_CSI_NVM;
3009
3010 ret = nvme_submit_sync_cmd(ctrl->admin_q, &c, id, sizeof(*id));
3011 if (ret)
3012 goto free_data;
3013
3014 if (id->dmrl)
3015 ctrl->max_discard_segments = id->dmrl;
3016 ctrl->dmrsl = le32_to_cpu(id->dmrsl);
3017 if (id->wzsl)
3018 ctrl->max_zeroes_sectors = nvme_mps_to_sectors(ctrl, id->wzsl);
3019
3020 free_data:
3021 if (ret > 0)
> 3022 set_bit(NVME_CTRL_SKIP_ID_CNS_CS, ctrl->flags);
3023 kfree(id);
3024 return ret;
3025 }
3026
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
More information about the Linux-nvme
mailing list