diff mbox

[1/2] IB/rxe: Remove unneeded check

Message ID 20170721191319.2966-1-yuval.shaia@oracle.com (mailing list archive)
State Superseded
Headers show

Commit Message

Yuval Shaia July 21, 2017, 7:13 p.m. UTC
Port validation is performed in ib_core, no need to duplicate it here.

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
---
 drivers/infiniband/sw/rxe/rxe_av.c | 7 -------
 1 file changed, 7 deletions(-)

Comments

kernel test robot July 23, 2017, 3:44 a.m. UTC | #1
Hi Yuval,

[auto build test WARNING on rdma/master]
[also build test WARNING on v4.13-rc1 next-20170721]
[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/Yuval-Shaia/IB-rxe-Remove-unneeded-check/20170723-111722
base:   https://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma.git master
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
        wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=xtensa 

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_av.c: In function 'rxe_av_chk_attr':
>> drivers/infiniband/sw/rxe/rxe_av.c:44:30: warning: 'port' may be used uninitialized in this function [-Wmaybe-uninitialized]
      if (sgid_index > port->attr.gid_tbl_len) {
                                 ^

vim +/port +44 drivers/infiniband/sw/rxe/rxe_av.c

8700e3e7 Moni Shoua                  2016-06-16  36  
90898850 Dasaratharaman Chandramouli 2017-04-29  37  int rxe_av_chk_attr(struct rxe_dev *rxe, struct rdma_ah_attr *attr)
8700e3e7 Moni Shoua                  2016-06-16  38  {
8700e3e7 Moni Shoua                  2016-06-16  39  	struct rxe_port *port;
8700e3e7 Moni Shoua                  2016-06-16  40  
d8966fcd Dasaratharaman Chandramouli 2017-04-29  41  	if (rdma_ah_get_ah_flags(attr) & IB_AH_GRH) {
d8966fcd Dasaratharaman Chandramouli 2017-04-29  42  		u8 sgid_index = rdma_ah_read_grh(attr)->sgid_index;
d8966fcd Dasaratharaman Chandramouli 2017-04-29  43  
d8966fcd Dasaratharaman Chandramouli 2017-04-29 @44  		if (sgid_index > port->attr.gid_tbl_len) {
d8966fcd Dasaratharaman Chandramouli 2017-04-29  45  			pr_info("invalid sgid index = %d\n", sgid_index);
8700e3e7 Moni Shoua                  2016-06-16  46  			return -EINVAL;
8700e3e7 Moni Shoua                  2016-06-16  47  		}
8700e3e7 Moni Shoua                  2016-06-16  48  	}
8700e3e7 Moni Shoua                  2016-06-16  49  
8700e3e7 Moni Shoua                  2016-06-16  50  	return 0;
8700e3e7 Moni Shoua                  2016-06-16  51  }
8700e3e7 Moni Shoua                  2016-06-16  52  

:::::: The code at line 44 was first introduced by commit
:::::: d8966fcd4c25708c3a76ea7619644218373df639 IB/core: Use rdma_ah_attr accessor functions

:::::: TO: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com>
:::::: CC: Doug Ledford <dledford@redhat.com>

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

Patch

diff --git a/drivers/infiniband/sw/rxe/rxe_av.c b/drivers/infiniband/sw/rxe/rxe_av.c
index 5bddf469361b..3f6122e37831 100644
--- a/drivers/infiniband/sw/rxe/rxe_av.c
+++ b/drivers/infiniband/sw/rxe/rxe_av.c
@@ -38,13 +38,6 @@  int rxe_av_chk_attr(struct rxe_dev *rxe, struct rdma_ah_attr *attr)
 {
 	struct rxe_port *port;
 
-	if (rdma_ah_get_port_num(attr) != 1) {
-		pr_info("invalid port_num = %d\n", rdma_ah_get_port_num(attr));
-		return -EINVAL;
-	}
-
-	port = &rxe->port;
-
 	if (rdma_ah_get_ah_flags(attr) & IB_AH_GRH) {
 		u8 sgid_index = rdma_ah_read_grh(attr)->sgid_index;