RDS: IB: Limit the scope of has_fr/has_fmr variables
authorAvinash Repaka <avinash.repaka@oracle.com>
Wed, 4 Oct 2017 19:10:43 +0000 (12:10 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 6 Oct 2017 04:16:33 +0000 (21:16 -0700)
This patch fixes the scope of has_fr and has_fmr variables as they are
needed only in rds_ib_add_one().

Signed-off-by: Avinash Repaka <avinash.repaka@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rds/ib.c
net/rds/ib.h

index a0954ace37744f41821efa6257d094a1ed7428b7..36dd2099048a8f6a46c15c06aa9f4106aa49ae6b 100644 (file)
@@ -126,6 +126,7 @@ void rds_ib_dev_put(struct rds_ib_device *rds_ibdev)
 static void rds_ib_add_one(struct ib_device *device)
 {
        struct rds_ib_device *rds_ibdev;
+       bool has_fr, has_fmr;
 
        /* Only handle IB (no iWARP) devices */
        if (device->node_type != RDMA_NODE_IB_CA)
@@ -143,11 +144,11 @@ static void rds_ib_add_one(struct ib_device *device)
        rds_ibdev->max_wrs = device->attrs.max_qp_wr;
        rds_ibdev->max_sge = min(device->attrs.max_sge, RDS_IB_MAX_SGE);
 
-       rds_ibdev->has_fr = (device->attrs.device_cap_flags &
-                                 IB_DEVICE_MEM_MGT_EXTENSIONS);
-       rds_ibdev->has_fmr = (device->alloc_fmr && device->dealloc_fmr &&
-                           device->map_phys_fmr && device->unmap_fmr);
-       rds_ibdev->use_fastreg = (rds_ibdev->has_fr && !rds_ibdev->has_fmr);
+       has_fr = (device->attrs.device_cap_flags &
+                 IB_DEVICE_MEM_MGT_EXTENSIONS);
+       has_fmr = (device->alloc_fmr && device->dealloc_fmr &&
+                  device->map_phys_fmr && device->unmap_fmr);
+       rds_ibdev->use_fastreg = (has_fr && !has_fmr);
 
        rds_ibdev->fmr_max_remaps = device->attrs.max_map_per_fmr?: 32;
        rds_ibdev->max_1m_mrs = device->attrs.max_mr ?
index bf4822407567044464b594e4e66a81dade3f0ed3..6ea6a27891b03239ed8486de520cff2ede8fc544 100644 (file)
@@ -215,8 +215,6 @@ struct rds_ib_device {
        struct list_head        conn_list;
        struct ib_device        *dev;
        struct ib_pd            *pd;
-       bool                    has_fmr;
-       bool                    has_fr;
        bool                    use_fastreg;
 
        unsigned int            max_mrs;