All of lore.kernel.org
 help / color / mirror / Atom feed
* [alibaba-cloud:linux-next 8423/9999] drivers/infiniband/core/addr.c:473:13: warning: variable 'ret' set but not used
@ 2023-03-21 18:03 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-03-21 18:03 UTC (permalink / raw)
  To: alikernel-developer; +Cc: oe-kbuild-all

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

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

only message in thread, other threads:[~2023-03-21 18:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-21 18:03 [alibaba-cloud:linux-next 8423/9999] drivers/infiniband/core/addr.c:473:13: warning: variable 'ret' set but not used kernel 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.