All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Konstantin Taranov <kotaranov@microsoft.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Leon Romanovsky <leon@kernel.org>,
	Shiraz Saleem <shirazsaleem@microsoft.com>,
	Long Li <longli@microsoft.com>
Subject: [leon-rdma:rdma-next 9/75] drivers/infiniband/hw/mana/qp.c:549:73: warning: variable 'err' is uninitialized when used here
Date: Tue, 4 Feb 2025 11:27:15 +0800	[thread overview]
Message-ID: <202502041114.n6Yv6u7p-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git rdma-next
head:   10565c5cadcb629f7780d24dd351878de9f46db5
commit: bf3f6576bbbd511bbf30244ef82b3e48b7ae0331 [9/75] RDMA/mana_ib: UD/GSI QP creation for kernel
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20250204/202502041114.n6Yv6u7p-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250204/202502041114.n6Yv6u7p-lkp@intel.com/reproduce)

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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502041114.n6Yv6u7p-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/infiniband/hw/mana/qp.c:6:
   In file included from drivers/infiniband/hw/mana/mana_ib.h:9:
   In file included from include/rdma/ib_verbs.h:15:
   In file included from include/linux/ethtool.h:18:
   In file included from include/linux/if_ether.h:19:
   In file included from include/linux/skbuff.h:17:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:8:
   In file included from include/linux/cacheflush.h:5:
   In file included from arch/x86/include/asm/cacheflush.h:5:
   In file included from include/linux/mm.h:2224:
   include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     504 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     505 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     511 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     512 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     524 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     525 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/infiniband/hw/mana/qp.c:549:73: warning: variable 'err' is uninitialized when used here [-Wuninitialized]
     549 |                 ibdev_dbg(&mdev->ib_dev, "User-level UD QPs are not supported, %d\n", err);
         |                                                                                       ^~~
   include/rdma/ib_verbs.h:80:37: note: expanded from macro 'ibdev_dbg'
      80 |         dynamic_ibdev_dbg(__dev, format, ##args)
         |                                            ^~~~
   include/linux/dynamic_debug.h:282:19: note: expanded from macro 'dynamic_ibdev_dbg'
     282 |                            dev, fmt, ##__VA_ARGS__)
         |                                        ^~~~~~~~~~~
   include/linux/dynamic_debug.h:250:59: note: expanded from macro '_dynamic_func_call'
     250 |         _dynamic_func_call_cls(_DPRINTK_CLASS_DFLT, fmt, func, ##__VA_ARGS__)
         |                                                                  ^~~~~~~~~~~
   include/linux/dynamic_debug.h:248:65: note: expanded from macro '_dynamic_func_call_cls'
     248 |         __dynamic_func_call_cls(__UNIQUE_ID(ddebug), cls, fmt, func, ##__VA_ARGS__)
         |                                                                        ^~~~~~~~~~~
   include/linux/dynamic_debug.h:224:15: note: expanded from macro '__dynamic_func_call_cls'
     224 |                 func(&id, ##__VA_ARGS__);                       \
         |                             ^~~~~~~~~~~
   drivers/infiniband/hw/mana/qp.c:546:12: note: initialize the variable 'err' to silence this warning
     546 |         int i, err;
         |                   ^
         |                    = 0
   4 warnings generated.


vim +/err +549 drivers/infiniband/hw/mana/qp.c

   538	
   539	static int mana_ib_create_ud_qp(struct ib_qp *ibqp, struct ib_pd *ibpd,
   540					struct ib_qp_init_attr *attr, struct ib_udata *udata)
   541	{
   542		struct mana_ib_dev *mdev = container_of(ibpd->device, struct mana_ib_dev, ib_dev);
   543		struct mana_ib_qp *qp = container_of(ibqp, struct mana_ib_qp, ibqp);
   544		struct gdma_context *gc = mdev_to_gc(mdev);
   545		u32 doorbell, queue_size;
   546		int i, err;
   547	
   548		if (udata) {
 > 549			ibdev_dbg(&mdev->ib_dev, "User-level UD QPs are not supported, %d\n", err);
   550			return -EINVAL;
   551		}
   552	
   553		for (i = 0; i < MANA_UD_QUEUE_TYPE_MAX; ++i) {
   554			queue_size = mana_ib_queue_size(attr, i);
   555			err = mana_ib_create_kernel_queue(mdev, queue_size, mana_ib_queue_type(attr, i),
   556							  &qp->ud_qp.queues[i]);
   557			if (err) {
   558				ibdev_err(&mdev->ib_dev, "Failed to create queue %d, err %d\n",
   559					  i, err);
   560				goto destroy_queues;
   561			}
   562		}
   563		doorbell = gc->mana_ib.doorbell;
   564	
   565		err = mana_ib_gd_create_ud_qp(mdev, qp, attr, doorbell, attr->qp_type);
   566		if (err) {
   567			ibdev_err(&mdev->ib_dev, "Failed to create ud qp  %d\n", err);
   568			goto destroy_queues;
   569		}
   570		qp->ibqp.qp_num = qp->ud_qp.queues[MANA_UD_RECV_QUEUE].id;
   571		qp->port = attr->port_num;
   572	
   573		for (i = 0; i < MANA_UD_QUEUE_TYPE_MAX; ++i)
   574			qp->ud_qp.queues[i].kmem->id = qp->ud_qp.queues[i].id;
   575	
   576		return 0;
   577	
   578	destroy_queues:
   579		while (i-- > 0)
   580			mana_ib_destroy_queue(mdev, &qp->ud_qp.queues[i]);
   581		return err;
   582	}
   583	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

             reply	other threads:[~2025-02-04  3:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-04  3:27 kernel test robot [this message]
2025-02-04  9:01 ` [leon-rdma:rdma-next 9/75] drivers/infiniband/hw/mana/qp.c:549:73: warning: variable 'err' is uninitialized when used here Leon Romanovsky

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=202502041114.n6Yv6u7p-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kotaranov@microsoft.com \
    --cc=leon@kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=longli@microsoft.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=shirazsaleem@microsoft.com \
    /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 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.