From: kernel test robot <lkp@intel.com>
To: Hannes Reinecke <hare@suse.de>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
linux-kernel@vger.kernel.org
Subject: [hare-scsi-devel:tls-upcall.v4 141/156] drivers/nvme/host/tcp.c:674:7: warning: variable 'map' is uninitialized when used here
Date: Sun, 13 Mar 2022 20:00:55 +0800 [thread overview]
Message-ID: <202203131914.rJjnMLih-lkp@intel.com> (raw)
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: i386-randconfig-a013 (https://download.01.org/0day-ci/archive/20220313/202203131914.rJjnMLih-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0467eb2cb7654c15ae366967ef35093c5724c416)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# 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
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/nvme/host/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/nvme/host/tcp.c:674:7: warning: variable 'map' is uninitialized when used here [-Wuninitialized]
if (map[i].fes == pdu->fes) {
^~~
drivers/nvme/host/tcp.c:668:28: note: initialize the variable 'map' to silence this warning
struct fes_status_map *map;
^
= NULL
1 warning generated.
vim +/map +674 drivers/nvme/host/tcp.c
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
reply other threads:[~2022-03-13 12:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202203131914.rJjnMLih-lkp@intel.com \
--to=lkp@intel.com \
--cc=hare@suse.de \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®