Skip to contentSkip to conversation

RDMA/irdma: Make irdma_create_mg_ctx return a void

PATCH Superseded [email protected] 3 participants 6 messages Feb 17, 2022 – Feb 24, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/irdma: Make irdma_create_mg_ctx return a void

From: Zhu Yanjun <[email protected]>

The function irdma_create_mg_ctx always returns 0, so make it void and delete the return value check.

---
 drivers/infiniband/hw/irdma/uda.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/infiniband/hw/irdma/uda.c +2 -7
index 7a9988ddbd01..5eeb76bc29fd 100644
@@ -86,8 +86,7 @@ enum irdma_status_code irdma_sc_access_ah(struct irdma_sc_cqp *cqp,
  * irdma_create_mg_ctx() - create a mcg context
  * @info: multicast group context info
  */
-static enum irdma_status_code
-irdma_create_mg_ctx(struct irdma_mcast_grp_info *info)
+static void irdma_create_mg_ctx(struct irdma_mcast_grp_info *info)
 {
 	struct irdma_mcast_grp_ctx_entry_info *entry_info = NULL;
 	u8 idx = 0; /* index in the array */
@@ -106,8 +105,6 @@ irdma_create_mg_ctx(struct irdma_mcast_grp_info *info)
 			ctx_idx++;
 		}
 	}
-
-	return 0;
 }
 
 /**
@@ -135,9 +132,7 @@ enum irdma_status_code irdma_access_mcast_grp(struct irdma_sc_cqp *cqp,
 		return IRDMA_ERR_RING_FULL;
 	}
 
-	ret_code = irdma_create_mg_ctx(info);
-	if (ret_code)
-		return ret_code;
+	irdma_create_mg_ctx(info);
 
 	set_64bit_val(wqe, 32, info->dma_mem_mc.pa);
 	set_64bit_val(wqe, 16,
Signature · 1 line
2.27.0
author
#1 lore raw
Quoted 6 lines · 在 2022/2/18 2:19, [email protected] 写道:

From: Zhu Yanjun <[email protected]>

The function irdma_create_mg_ctx always returns 0, so make it void and delete the return value check.

gentle ping

Zhu Yanjun

Quoted 38 lines
---
  drivers/infiniband/hw/irdma/uda.c | 9 ++-------
  1 file changed, 2 insertions(+), 7 deletions(-)
drivers/infiniband/hw/irdma/uda.c +2 -7
index 7a9988ddbd01..5eeb76bc29fd 100644
@@ -86,8 +86,7 @@ enum irdma_status_code irdma_sc_access_ah(struct irdma_sc_cqp *cqp,
   * irdma_create_mg_ctx() - create a mcg context
   * @info: multicast group context info
   */
-static enum irdma_status_code
-irdma_create_mg_ctx(struct irdma_mcast_grp_info *info)
+static void irdma_create_mg_ctx(struct irdma_mcast_grp_info *info)
  {
  	struct irdma_mcast_grp_ctx_entry_info *entry_info = NULL;
  	u8 idx = 0; /* index in the array */
@@ -106,8 +105,6 @@ irdma_create_mg_ctx(struct irdma_mcast_grp_info *info)
  			ctx_idx++;
  		}
  	}
-
-	return 0;
  }
 
  /**
@@ -135,9 +132,7 @@ enum irdma_status_code irdma_access_mcast_grp(struct irdma_sc_cqp *cqp,
  		return IRDMA_ERR_RING_FULL;
  	}
 
-	ret_code = irdma_create_mg_ctx(info);
-	if (ret_code)
-		return ret_code;
+	irdma_create_mg_ctx(info);
 
  	set_64bit_val(wqe, 32, info->dma_mem_mc.pa);
  	set_64bit_val(wqe, 16,
#2 lore raw
Quoted 45 lines

Subject: Re: [PATCH 1/1] RDMA/irdma: Make irdma_create_mg_ctx return a void

Quoted 6 lines · 在 2022/2/18 2:19, [email protected] 写道:

From: Zhu Yanjun <[email protected]>

The function irdma_create_mg_ctx always returns 0, so make it void and delete the return value check.

gentle ping

Zhu Yanjun

drivers/infiniband/hw/irdma/uda.c enum irdma_status_code irdma_sc_access_ah(struct

Quoted 10 lines
---
  drivers/infiniband/hw/irdma/uda.c | 9 ++-------
  1 file changed, 2 insertions(+), 7 deletions(-)
drivers/infiniband/hw/irdma/uda.c +0 -0
index 7a9988ddbd01..5eeb76bc29fd 100644
@@ -86,8 +86,7 @@ enum irdma_status_code irdma_sc_access_ah(struct

irdma_sc_cqp *cqp,

drivers/infiniband/hw/irdma/uda.c enum irdma_status_code

Quoted 19 lines
drivers/infiniband/hw/irdma/uda.c +1 -2
   * irdma_create_mg_ctx() - create a mcg context
   * @info: multicast group context info
   */
-static enum irdma_status_code
-irdma_create_mg_ctx(struct irdma_mcast_grp_info *info)
+static void irdma_create_mg_ctx(struct irdma_mcast_grp_info *info)
  {
  	struct irdma_mcast_grp_ctx_entry_info *entry_info = NULL;
  	u8 idx = 0; /* index in the array */ @@ -106,8 +105,6 @@

irdma_create_mg_ctx(struct irdma_mcast_grp_info *info)
ctx_idx++;
}
}

drivers/infiniband/hw/irdma/uda.c +0 -2
-
-	return 0;
  }
 
  /**
@@ -135,9 +132,7 @@ enum irdma_status_code

irdma_access_mcast_grp(struct irdma_sc_cqp *cqp,

Quoted 7 lines

drivers/infiniband/hw/irdma/uda.c enum irdma_status_code irdma_access_mcast_grp(struct irdma_sc_cqp *cqp, · line 135

Quoted 7 lines
drivers/infiniband/hw/irdma/uda.c +1 -3
  		return IRDMA_ERR_RING_FULL;
  	}
 
-	ret_code = irdma_create_mg_ctx(info);
-	if (ret_code)
-		return ret_code;
+	irdma_create_mg_ctx(info);

ret_code is unused now? Get rid of it?

Shiraz

author
#3 lore raw
Quoted 44 lines · Shiraz
Quoted 44 lines

Subject: Re: [PATCH 1/1] RDMA/irdma: Make irdma_create_mg_ctx return a void

Quoted 6 lines · 在 2022/2/18 2:19, [email protected] 写道:

From: Zhu Yanjun <[email protected]>

The function irdma_create_mg_ctx always returns 0, so make it void and delete the return value check.

gentle ping

Zhu Yanjun

drivers/infiniband/hw/irdma/uda.c enum irdma_status_code irdma_sc_access_ah(struct

Quoted 10 lines
---
   drivers/infiniband/hw/irdma/uda.c | 9 ++-------
   1 file changed, 2 insertions(+), 7 deletions(-)
drivers/infiniband/hw/irdma/uda.c +0 -0
index 7a9988ddbd01..5eeb76bc29fd 100644
@@ -86,8 +86,7 @@ enum irdma_status_code irdma_sc_access_ah(struct

irdma_sc_cqp *cqp,

drivers/infiniband/hw/irdma/uda.c enum irdma_status_code

Quoted 19 lines
drivers/infiniband/hw/irdma/uda.c +1 -2
    * irdma_create_mg_ctx() - create a mcg context
    * @info: multicast group context info
    */
-static enum irdma_status_code
-irdma_create_mg_ctx(struct irdma_mcast_grp_info *info)
+static void irdma_create_mg_ctx(struct irdma_mcast_grp_info *info)
   {
   	struct irdma_mcast_grp_ctx_entry_info *entry_info = NULL;
   	u8 idx = 0; /* index in the array */ @@ -106,8 +105,6 @@

irdma_create_mg_ctx(struct irdma_mcast_grp_info *info)

   			ctx_idx++;
   		}
   	}
drivers/infiniband/hw/irdma/uda.c +0 -2
-
-	return 0;
   }
 
   /**
@@ -135,9 +132,7 @@ enum irdma_status_code

irdma_access_mcast_grp(struct irdma_sc_cqp *cqp,

Quoted 8 lines
Quoted 7 lines

drivers/infiniband/hw/irdma/uda.c enum irdma_status_code irdma_access_mcast_grp(struct irdma_sc_cqp *cqp, · line 135

Quoted 7 lines
drivers/infiniband/hw/irdma/uda.c +1 -3
   		return IRDMA_ERR_RING_FULL;
   	}
 
-	ret_code = irdma_create_mg_ctx(info);
-	if (ret_code)
-		return ret_code;
+	irdma_create_mg_ctx(info);

ret_code is unused now? Get rid of it?

Thanks, it is removed in the latest commit.

Zhu Yanjun

Quoted 2 lines

Shiraz

maintainer
#4 lore raw
In reply to [email protected]
Quoted 9 lines · On Thu, Feb 17, 2022 at 01:19:38PM -0500, [email protected] wrote:

From: Zhu Yanjun <[email protected]>

The function irdma_create_mg_ctx always returns 0, so make it void and delete the return value check.

---
 drivers/infiniband/hw/irdma/uda.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

This doesn't apply please rebase it to commit 2322d17abf0a ("RDMA/irdma: Remove excess error variables")

Jason

author
#5 lore raw
Quoted 6 lines · Jason Gunthorpe
Quoted 5 lines · On Thu, Feb 17, 2022 at 01:19:38PM -0500, [email protected] wrote:

From: Zhu Yanjun <[email protected]>

The function irdma_create_mg_ctx always returns 0, so make it void and delete the return value check.

Quoted 6 lines
Quoted 4 lines
---
  drivers/infiniband/hw/irdma/uda.c | 9 ++-------
  1 file changed, 2 insertions(+), 7 deletions(-)

This doesn't apply please rebase it to commit 2322d17abf0a ("RDMA/irdma: Remove excess error variables")

Thanks. Now the latest commit is on the commit 2322d17abf0a

("RDMA/irdma: Remove excess error variables").

Zhu Yanjun

Quoted 2 lines

Jason