Hi Keith,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on axboe-block/for-next]
[also build test WARNING on linux/master linus/master v5.17-rc1 next-20220124]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/Keith-Busch/64-bit-data-integrit...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next
config: x86_64-randconfig-s021-20220124
(
https://download.01.org/0day-ci/archive/20220125/202201250552.LY0QkQNT-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
#
https://github.com/0day-ci/linux/commit/15e965a414da565fcf7d7aa958a9850bb...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Keith-Busch/64-bit-data-integrity-field-support/20220125-000232
git checkout 15e965a414da565fcf7d7aa958a9850bb714db17
# save the config file to linux build tree
mkdir build_dir
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir
ARCH=x86_64 SHELL=/bin/bash drivers/nvme/host/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
> drivers/nvme/host/core.c:1805:17: sparse: sparse: cast from
restricted __le32
> drivers/nvme/host/core.c:1805:15: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned int [usertype] elbaf @@ got restricted
__le32 [usertype] @@
drivers/nvme/host/core.c:1805:15: sparse: expected
unsigned int [usertype] elbaf
drivers/nvme/host/core.c:1805:15: sparse: got restricted __le32 [usertype]
vim +1805 drivers/nvme/host/core.c
1773
1774 static int nvme_init_ms(struct nvme_ns *ns, struct nvme_id_ns *id)
1775 {
1776 bool first = id->dps & NVME_NS_DPS_PI_FIRST;
1777 unsigned lbaf = nvme_lbaf_index(id->flbas);
1778 struct nvme_ctrl *ctrl = ns->ctrl;
1779 struct nvme_command c = { };
1780 struct nvme_id_ns_nvm *nvm;
1781 u8 pi_size = 0;
1782 int ret = 0;
1783 u32 elbaf;
1784
1785 ns->ms = le16_to_cpu(id->lbaf[lbaf].ms);
1786 if (!(ctrl->ctratt & NVME_CTRL_ATTR_ELBAS)) {
1787 pi_size = sizeof(struct t10_pi_tuple);
1788 ns->guard_type = NVME_NVM_NS_16B_GUARD;
1789 goto set_pi;
1790 }
1791
1792 nvm = kzalloc(sizeof(*nvm), GFP_KERNEL);
1793 if (!nvm)
1794 return -ENOMEM;
1795
1796 c.identify.opcode = nvme_admin_identify;
1797 c.identify.nsid = cpu_to_le32(ns->head->ns_id);
1798 c.identify.cns = NVME_ID_CNS_CS_NS;
1799 c.identify.csi = NVME_CSI_NVM;
1800
1801 ret = nvme_submit_sync_cmd(ns->ctrl->admin_q, &c, nvm, sizeof(*nvm));
1802 if (ret)
1803 goto free_data;
1804
1805 elbaf = cpu_to_le32(nvm->elbaf[lbaf]);
1806
1807 /* no support for storage tag formats right now */
1808 if (nvme_elbaf_sts(elbaf))
1809 goto free_data;
1810
1811 ns->guard_type = nvme_elbaf_guard_type(elbaf);
1812 switch (ns->guard_type) {
1813 case NVME_NVM_NS_64B_GUARD:
1814 pi_size = sizeof(struct nvme_crc64_pi_tuple);
1815 break;
1816 case NVME_NVM_NS_16B_GUARD:
1817 pi_size = sizeof(struct t10_pi_tuple);
1818 break;
1819 default:
1820 break;
1821 }
1822
1823 free_data:
1824 kfree(nvm);
1825 set_pi:
1826 if (pi_size && (first || ns->ms == pi_size))
1827 ns->pi_type = id->dps & NVME_NS_DPS_PI_MASK;
1828 else
1829 ns->pi_type = 0;
1830
1831 return ret;
1832 }
1833
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org