Re: [PATCH 2/2] IB/rxe: remove unnecessary initialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Zhu,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.16-rc5 next-20180316]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Zhu-Yanjun/IB-rxe-optimize-the-recv-process/20180318-130259
config: i386-randconfig-x072-201811 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   drivers/infiniband/sw/rxe/rxe_verbs.c: In function 'rxe_query_port':
>> drivers/infiniband/sw/rxe/rxe_verbs.c:77:9: warning: 'rc' may be used uninitialized in this function [-Wmaybe-uninitialized]
     return rc;
            ^~

vim +/rc +77 drivers/infiniband/sw/rxe/rxe_verbs.c

8700e3e7c Moni Shoua   2016-06-16  53  
8700e3e7c Moni Shoua   2016-06-16  54  static int rxe_query_port(struct ib_device *dev,
8700e3e7c Moni Shoua   2016-06-16  55  			  u8 port_num, struct ib_port_attr *attr)
8700e3e7c Moni Shoua   2016-06-16  56  {
8700e3e7c Moni Shoua   2016-06-16  57  	struct rxe_dev *rxe = to_rdev(dev);
8700e3e7c Moni Shoua   2016-06-16  58  	struct rxe_port *port;
6c58dc395 Zhu Yanjun   2018-03-17  59  	int rc;
8700e3e7c Moni Shoua   2016-06-16  60  
8700e3e7c Moni Shoua   2016-06-16  61  	if (unlikely(port_num != 1)) {
8700e3e7c Moni Shoua   2016-06-16  62  		pr_warn("invalid port_number %d\n", port_num);
d41861942 Yuval Shaia  2017-06-14  63  		goto out;
8700e3e7c Moni Shoua   2016-06-16  64  	}
8700e3e7c Moni Shoua   2016-06-16  65  
8700e3e7c Moni Shoua   2016-06-16  66  	port = &rxe->port;
8700e3e7c Moni Shoua   2016-06-16  67  
c4550c63b Or Gerlitz   2017-01-24  68  	/* *attr being zeroed by the caller, avoid zeroing it here */
8700e3e7c Moni Shoua   2016-06-16  69  	*attr = port->attr;
8700e3e7c Moni Shoua   2016-06-16  70  
8700e3e7c Moni Shoua   2016-06-16  71  	mutex_lock(&rxe->usdev_lock);
d41861942 Yuval Shaia  2017-06-14  72  	rc = ib_get_eth_speed(dev, port_num, &attr->active_speed,
e404f945a Parav Pandit 2016-09-28  73  			      &attr->active_width);
8700e3e7c Moni Shoua   2016-06-16  74  	mutex_unlock(&rxe->usdev_lock);
8700e3e7c Moni Shoua   2016-06-16  75  
d41861942 Yuval Shaia  2017-06-14  76  out:
d41861942 Yuval Shaia  2017-06-14 @77  	return rc;
8700e3e7c Moni Shoua   2016-06-16  78  }
8700e3e7c Moni Shoua   2016-06-16  79  

:::::: The code at line 77 was first introduced by commit
:::::: d41861942fc55c14b6280d9568a0d0112037f065 IB/core: Add generic function to extract IB speed from netdev

:::::: TO: Yuval Shaia <yuval.shaia@xxxxxxxxxx>
:::::: CC: Doug Ledford <dledford@xxxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux