Skip to contentSkip to conversation

RDMA/rtrs: server: use already dereferenced rtrs_sess structure

PATCH Applied [email protected] 3 participants 3 messages May 22, 2020 – May 23, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/rtrs: server: use already dereferenced rtrs_sess structure

From: Md Haris Iqbal <[email protected]>

The rtrs_sess structure has already been extracted above from the rtrs_srv_sess structure. Use that to avoid redundant dereferencing.

Fixes 9cb837480424 ("RDMA/rtrs: server: main functionality")
---
 drivers/infiniband/ulp/rtrs/rtrs-srv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/ulp/rtrs/rtrs-srv.c +2 -2
index 1fc6ece036ff..5ef8988ee75b 100644
@@ -1822,13 +1822,13 @@ static int rtrs_rdma_connect(struct rdma_cm_id *cm_id,
 		/*
 		 * Sanity checks
 		 */
-		if (con_num != sess->s.con_num || cid >= sess->s.con_num) {
+		if (con_num != s->con_num || cid >= s->con_num) {
 			rtrs_err(s, "Incorrect request: %d, %d\n",
 				  cid, con_num);
 			mutex_unlock(&srv->paths_mutex);
 			goto reject_w_econnreset;
 		}
-		if (sess->s.con[cid]) {
+		if (s->con[cid]) {
 			rtrs_err(s, "Connection already exists: %d\n",
 				  cid);
 			mutex_unlock(&srv->paths_mutex);
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 33 lines · On Fri, May 22, 2020 at 10:28 AM <[email protected]> wrote:

From: Md Haris Iqbal <[email protected]>

The rtrs_sess structure has already been extracted above from the rtrs_srv_sess structure. Use that to avoid redundant dereferencing.

Fixes 9cb837480424 ("RDMA/rtrs: server: main functionality")
---
 drivers/infiniband/ulp/rtrs/rtrs-srv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/ulp/rtrs/rtrs-srv.c +2 -3
index 1fc6ece036ff..5ef8988ee75b 100644
@@ -1822,13 +1822,13 @@ static int rtrs_rdma_connect(struct rdma_cm_id *cm_id,
                /*
                 * Sanity checks
                 */
-               if (con_num != sess->s.con_num || cid >= sess->s.con_num) {
+               if (con_num != s->con_num || cid >= s->con_num) {
                        rtrs_err(s, "Incorrect request: %d, %d\n",
                                  cid, con_num);
                        mutex_unlock(&srv->paths_mutex);
                        goto reject_w_econnreset;
                }
-               if (sess->s.con[cid]) {
+               if (s->con[cid]) {
                        rtrs_err(s, "Connection already exists: %d\n",
                                  cid);
                        mutex_unlock(&srv->paths_mutex);
--
Quoted 2 lines

2.25.1

Thanks Haris.

#2 lore raw
In reply to [email protected]
Quoted 11 lines · On Fri, May 22, 2020 at 08:28:33AM +0000, [email protected] wrote:

From: Md Haris Iqbal <[email protected]>

The rtrs_sess structure has already been extracted above from the rtrs_srv_sess structure. Use that to avoid redundant dereferencing.

Fixes 9cb837480424 ("RDMA/rtrs: server: main functionality")
---
 drivers/infiniband/ulp/rtrs/rtrs-srv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied to for-next, thanks

Jason