[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202203141612.l0D9X0i9-lkp@intel.com>
Date: Mon, 14 Mar 2022 16:36:57 +0800
From: kernel test robot <lkp@...el.com>
To: Hannes Reinecke <hare@...e.de>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [hare-scsi-devel:tls-upcall.v4 141/156]
drivers/nvme/host/tcp.c:655:3: sparse: sparse: symbol 'fes_status' was not
declared. Should it be static?
tree: https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git tls-upcall.v4
head: d2416ecdb6b03fc2e4aa40b20cdf919322713224
commit: fb16aba001d4b403be727c8dd379da6e3dbf56e4 [141/156] nvme-tcp: decode c2h term PDU
config: x86_64-randconfig-s021 (https://download.01.org/0day-ci/archive/20220314/202203141612.l0D9X0i9-lkp@intel.com/config)
compiler: gcc-9 (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git/commit/?id=fb16aba001d4b403be727c8dd379da6e3dbf56e4
git remote add hare-scsi-devel https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git
git fetch --no-tags hare-scsi-devel tls-upcall.v4
git checkout fb16aba001d4b403be727c8dd379da6e3dbf56e4
# 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
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/nvme/host/tcp.c:655:3: sparse: sparse: symbol 'fes_status' was not declared. Should it be static?
>> drivers/nvme/host/tcp.c:674:38: sparse: sparse: restricted __le16 degrades to integer
>> drivers/nvme/host/tcp.c:682:21: sparse: sparse: restricted __le32 degrades to integer
drivers/nvme/host/tcp.c:685:16: sparse: sparse: restricted __le16 degrades to integer
drivers/nvme/host/tcp.c:686:16: sparse: sparse: restricted __le16 degrades to integer
drivers/nvme/host/tcp.c:687:16: sparse: sparse: restricted __le16 degrades to integer
vim +/fes_status +655 drivers/nvme/host/tcp.c
651
652 struct fes_status_map {
653 enum nvme_tcp_fatal_error_status fes;
654 const char *desc;
> 655 } fes_status[] = {
656 { NVME_TCP_FES_INVALID_PDU_HDR, "invalid pdu header"},
657 { NVME_TCP_FES_PDU_SEQ_ERR, "pdu sequence error" },
658 { NVME_TCP_FES_HDR_DIGEST_ERR, "header digest error" },
659 { NVME_TCP_FES_DATA_OUT_OF_RANGE, "data transfer out of range" },
660 { NVME_TCP_FES_DATA_LIMIT_EXCEEDED, "data limit exceeded" },
661 { NVME_TCP_FES_UNSUPPORTED_PARAM, "unsupported parameter" },
662 };
663
664 static int nvme_tcp_handle_c2h_term(struct nvme_tcp_queue *queue,
665 struct nvme_tcp_term_pdu *pdu)
666 {
667 struct nvme_tcp_hdr *ref_pdu;
668 struct fes_status_map *map;
669 const char *fes_desc = NULL;
670 int i;
671 u32 pdu_offset;
672
673 for (i = 0; i < ARRAY_SIZE(fes_status); i++) {
> 674 if (map[i].fes == pdu->fes) {
675 fes_desc = map[i].desc;
676 break;
677 }
678 }
679 if (!fes_desc)
680 fes_desc = "unknown fatal error status";
681
> 682 if (pdu->hdr.plen > sizeof(struct nvme_tcp_term_pdu))
683 ref_pdu = (struct nvme_tcp_hdr *)((u8 *)pdu + 1);
684
685 if (pdu->fes == NVME_TCP_FES_INVALID_PDU_HDR ||
686 pdu->fes == NVME_TCP_FES_HDR_DIGEST_ERR ||
687 pdu->fes == NVME_TCP_FES_UNSUPPORTED_PARAM) {
688 pdu_offset = le32_to_cpu(pdu->fei);
689
690 dev_err(queue->ctrl->ctrl.device,
691 "queue %d c2h term, %s, pdu type %u offset %u\n",
692 nvme_tcp_queue_id(queue), fes_desc, ref_pdu->type, pdu_offset);
693 } else
694 dev_err(queue->ctrl->ctrl.device,
695 "queue %d c2h term, %s, pdu type %u\n",
696 nvme_tcp_queue_id(queue), fes_desc, ref_pdu->type);
697
698 return -ECONNRESET;
699 }
700
---
0-DAY CI Kernel Test Service
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Powered by blists - more mailing lists