All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-nvme:nvme-5.8 41/41] drivers/nvme/target/rdma.c:959:9: warning: Variable 'ret' is not assigned a value. [unassignedVariable]
@ 2020-04-07  8:34 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-04-07  8:34 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 4645 bytes --]

tree:   git://git.infradead.org/nvme.git nvme-5.8
head:   25964eac12b9cda50af7995674d418a39029c328
commit: 25964eac12b9cda50af7995674d418a39029c328 [41/41] nvmet-rdma: use SRQ per completion vector
:::::: branch date: 7 hours ago
:::::: commit date: 7 hours ago

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

cppcheck warnings: (new ones prefixed by >>)

   drivers/nvme/target/rdma.c:1365:6: warning: Redundant initialization for 'ret'. The initialized value is overwritten before it is read. [redundantInitialization]
    ret = rdma_accept(cm_id, &param);
        ^
   drivers/nvme/target/rdma.c:1354:10: note: ret is initialized
    int ret = -ENOMEM;
            ^
   drivers/nvme/target/rdma.c:1365:6: note: ret is overwritten
    ret = rdma_accept(cm_id, &param);
        ^
   drivers/nvme/target/rdma.c:1398:6: warning: Redundant initialization for 'ret'. The initialized value is overwritten before it is read. [redundantInitialization]
    ret = nvmet_rdma_cm_accept(cm_id, queue, &event->param.conn);
        ^
   drivers/nvme/target/rdma.c:1378:10: note: ret is initialized
    int ret = -EINVAL;
            ^
   drivers/nvme/target/rdma.c:1398:6: note: ret is overwritten
    ret = nvmet_rdma_cm_accept(cm_id, queue, &event->param.conn);
        ^
>> drivers/nvme/target/rdma.c:959:9: warning: Variable 'ret' is not assigned a value. [unassignedVariable]
    int i, ret;
           ^

git remote add linux-nvme git://git.infradead.org/nvme.git
git remote update linux-nvme
git checkout 25964eac12b9cda50af7995674d418a39029c328
vim +/ret +959 drivers/nvme/target/rdma.c

25964eac12b9cda Max Gurtovoy      2017-04-19  956  
25964eac12b9cda Max Gurtovoy      2017-04-19  957  static int nvmet_rdma_init_srqs(struct nvmet_rdma_device *ndev)
25964eac12b9cda Max Gurtovoy      2017-04-19  958  {
25964eac12b9cda Max Gurtovoy      2017-04-19 @959  	int i, ret;
25964eac12b9cda Max Gurtovoy      2017-04-19  960  
25964eac12b9cda Max Gurtovoy      2017-04-19  961  	if (!ndev->device->attrs.max_srq_wr || !ndev->device->attrs.max_srq) {
25964eac12b9cda Max Gurtovoy      2017-04-19  962  		/*
25964eac12b9cda Max Gurtovoy      2017-04-19  963  		 * If SRQs aren't supported we just go ahead and use normal
25964eac12b9cda Max Gurtovoy      2017-04-19  964  		 * non-shared receive queues.
25964eac12b9cda Max Gurtovoy      2017-04-19  965  		 */
25964eac12b9cda Max Gurtovoy      2017-04-19  966  		pr_info("SRQ requested but not supported.\n");
25964eac12b9cda Max Gurtovoy      2017-04-19  967  		return 0;
25964eac12b9cda Max Gurtovoy      2017-04-19  968  	}
25964eac12b9cda Max Gurtovoy      2017-04-19  969  
25964eac12b9cda Max Gurtovoy      2017-04-19  970  	ndev->srq_size = min(ndev->device->attrs.max_srq_wr,
25964eac12b9cda Max Gurtovoy      2017-04-19  971  			     nvmet_rdma_srq_size);
25964eac12b9cda Max Gurtovoy      2017-04-19  972  	ndev->srq_count = min(ndev->device->num_comp_vectors,
25964eac12b9cda Max Gurtovoy      2017-04-19  973  			      ndev->device->attrs.max_srq);
25964eac12b9cda Max Gurtovoy      2017-04-19  974  
25964eac12b9cda Max Gurtovoy      2017-04-19  975  	ndev->srqs = kcalloc(ndev->srq_count, sizeof(*ndev->srqs), GFP_KERNEL);
25964eac12b9cda Max Gurtovoy      2017-04-19  976  	if (!ndev->srqs)
25964eac12b9cda Max Gurtovoy      2017-04-19  977  		return -ENOMEM;
25964eac12b9cda Max Gurtovoy      2017-04-19  978  
25964eac12b9cda Max Gurtovoy      2017-04-19  979  	for (i = 0; i < ndev->srq_count; i++) {
25964eac12b9cda Max Gurtovoy      2017-04-19  980  		ndev->srqs[i] = nvmet_rdma_init_srq(ndev);
25964eac12b9cda Max Gurtovoy      2017-04-19  981  		if (IS_ERR(ndev->srqs[i]))
25964eac12b9cda Max Gurtovoy      2017-04-19  982  			goto err_srq;
25964eac12b9cda Max Gurtovoy      2017-04-19  983  	}
25964eac12b9cda Max Gurtovoy      2017-04-19  984  
25964eac12b9cda Max Gurtovoy      2017-04-19  985  	return 0;
25964eac12b9cda Max Gurtovoy      2017-04-19  986  
25964eac12b9cda Max Gurtovoy      2017-04-19  987  err_srq:
25964eac12b9cda Max Gurtovoy      2017-04-19  988  	while (--i >= 0)
25964eac12b9cda Max Gurtovoy      2017-04-19  989  		nvmet_rdma_destroy_srq(ndev->srqs[i]);
25964eac12b9cda Max Gurtovoy      2017-04-19  990  	kfree(ndev->srqs);
8f000cac6e7a6ed Christoph Hellwig 2016-07-06  991  	return ret;
8f000cac6e7a6ed Christoph Hellwig 2016-07-06  992  }
8f000cac6e7a6ed Christoph Hellwig 2016-07-06  993  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-07  8:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-07  8:34 [linux-nvme:nvme-5.8 41/41] drivers/nvme/target/rdma.c:959:9: warning: Variable 'ret' is not assigned a value. [unassignedVariable] kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.