All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: alikernel-developer@linux.alibaba.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [alibaba-cloud:linux-next 8423/9999] drivers/infiniband/core/addr.c:473:13: warning: variable 'ret' set but not used
Date: Wed, 22 Mar 2023 02:03:09 +0800	[thread overview]
Message-ID: <202303220105.k4IYt222-lkp@intel.com> (raw)

tree:   https://github.com/alibaba/cloud-kernel.git linux-next
head:   d121e0c25d1a19485d7f293b67901462bb1a6552
commit: d6d722c84c60b998067871f2d96e9dc4e5da706f [8423/9999] RDMA/core: Protect against changing dst->dev during destination resolve
config: x86_64-randconfig-a015 (https://download.01.org/0day-ci/archive/20230322/202303220105.k4IYt222-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/alibaba/cloud-kernel/commit/d6d722c84c60b998067871f2d96e9dc4e5da706f
        git remote add alibaba-cloud https://github.com/alibaba/cloud-kernel.git
        git fetch --no-tags alibaba-cloud linux-next
        git checkout d6d722c84c60b998067871f2d96e9dc4e5da706f
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=x86_64 olddefconfig
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/infiniband/core/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303220105.k4IYt222-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/infiniband/core/addr.c: In function 'copy_src_l2_addr':
>> drivers/infiniband/core/addr.c:473:13: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
     473 |         int ret = 0;
         |             ^~~


vim +/ret +473 drivers/infiniband/core/addr.c

200298326b276d Matan Barak  2015-12-23  467  
d6d722c84c60b9 Parav Pandit 2018-09-05  468  static void copy_src_l2_addr(struct rdma_dev_addr *dev_addr,
23084924636ed4 Parav Pandit 2018-09-05  469  			     const struct sockaddr *dst_in,
d6d722c84c60b9 Parav Pandit 2018-09-05  470  			     const struct dst_entry *dst,
d6d722c84c60b9 Parav Pandit 2018-09-05  471  			     const struct net_device *ndev)
23084924636ed4 Parav Pandit 2018-09-05  472  {
23084924636ed4 Parav Pandit 2018-09-05 @473  	int ret = 0;
23084924636ed4 Parav Pandit 2018-09-05  474  
23084924636ed4 Parav Pandit 2018-09-05  475  	if (dst->dev->flags & IFF_LOOPBACK)
23084924636ed4 Parav Pandit 2018-09-05  476  		ret = rdma_translate_ip(dst_in, dev_addr);
23084924636ed4 Parav Pandit 2018-09-05  477  	else
0652a52eb6eec4 Parav Pandit 2018-09-05  478  		rdma_copy_src_l2_addr(dev_addr, dst->dev);
32fb22f5355899 Parav Pandit 2018-09-05  479  
32fb22f5355899 Parav Pandit 2018-09-05  480  	/*
32fb22f5355899 Parav Pandit 2018-09-05  481  	 * If there's a gateway and type of device not ARPHRD_INFINIBAND,
32fb22f5355899 Parav Pandit 2018-09-05  482  	 * we're definitely in RoCE v2 (as RoCE v1 isn't routable) set the
32fb22f5355899 Parav Pandit 2018-09-05  483  	 * network type accordingly.
32fb22f5355899 Parav Pandit 2018-09-05  484  	 */
32fb22f5355899 Parav Pandit 2018-09-05  485  	if (has_gateway(dst, dst_in->sa_family) &&
d6d722c84c60b9 Parav Pandit 2018-09-05  486  	    ndev->type != ARPHRD_INFINIBAND)
32fb22f5355899 Parav Pandit 2018-09-05  487  		dev_addr->network = dst_in->sa_family == AF_INET ?
32fb22f5355899 Parav Pandit 2018-09-05  488  						RDMA_NETWORK_IPV4 :
32fb22f5355899 Parav Pandit 2018-09-05  489  						RDMA_NETWORK_IPV6;
32fb22f5355899 Parav Pandit 2018-09-05  490  	else
32fb22f5355899 Parav Pandit 2018-09-05  491  		dev_addr->network = RDMA_NETWORK_IB;
d6d722c84c60b9 Parav Pandit 2018-09-05  492  }
32fb22f5355899 Parav Pandit 2018-09-05  493  

:::::: The code at line 473 was first introduced by commit
:::::: 23084924636ed44eaea811f8d28c5f80dbb76461 RDMA/core: Introduce and use rdma_set_src_addr() between IPv4 and IPv6

:::::: TO: Parav Pandit <parav@mellanox.com>
:::::: CC: Xuan Zhuo <xuanzhuo@linux.alibaba.com>

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

                 reply	other threads:[~2023-03-21 18:04 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=202303220105.k4IYt222-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=alikernel-developer@linux.alibaba.com \
    --cc=oe-kbuild-all@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 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.