Skip to content

Commit 7f1d541

Browse files
chuckleveramschuma-ntap
authored andcommitted
xprtrdma: Make rpcrdma_ep_destroy() return void
Clean up: rpcrdma_ep_destroy() returns a value that is used only to print a debugging message. rpcrdma_ep_destroy() already prints debugging messages in all error cases. Make rpcrdma_ep_destroy() return void instead. Signed-off-by: Chuck Lever <[email protected]> Tested-by: Steve Wise <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 13c9ff8 commit 7f1d541

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

net/sunrpc/xprtrdma/transport.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ static void
229229
xprt_rdma_destroy(struct rpc_xprt *xprt)
230230
{
231231
struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt);
232-
int rc;
233232

234233
dprintk("RPC: %s: called\n", __func__);
235234

@@ -238,10 +237,7 @@ xprt_rdma_destroy(struct rpc_xprt *xprt)
238237
xprt_clear_connected(xprt);
239238

240239
rpcrdma_buffer_destroy(&r_xprt->rx_buf);
241-
rc = rpcrdma_ep_destroy(&r_xprt->rx_ep, &r_xprt->rx_ia);
242-
if (rc)
243-
dprintk("RPC: %s: rpcrdma_ep_destroy returned %i\n",
244-
__func__, rc);
240+
rpcrdma_ep_destroy(&r_xprt->rx_ep, &r_xprt->rx_ia);
245241
rpcrdma_ia_close(&r_xprt->rx_ia);
246242

247243
xprt_rdma_free_addresses(xprt);
@@ -391,7 +387,7 @@ xprt_setup_rdma(struct xprt_create *args)
391387
xprt_rdma_free_addresses(xprt);
392388
rc = -EINVAL;
393389
out3:
394-
(void) rpcrdma_ep_destroy(new_ep, &new_xprt->rx_ia);
390+
rpcrdma_ep_destroy(new_ep, &new_xprt->rx_ia);
395391
out2:
396392
rpcrdma_ia_close(&new_xprt->rx_ia);
397393
out1:

net/sunrpc/xprtrdma/verbs.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -748,11 +748,8 @@ rpcrdma_ep_create(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia,
748748
* Disconnect and destroy endpoint. After this, the only
749749
* valid operations on the ep are to free it (if dynamically
750750
* allocated) or re-create it.
751-
*
752-
* The caller's error handling must be sure to not leak the endpoint
753-
* if this function fails.
754751
*/
755-
int
752+
void
756753
rpcrdma_ep_destroy(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia)
757754
{
758755
int rc;
@@ -782,8 +779,6 @@ rpcrdma_ep_destroy(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia)
782779
if (rc)
783780
dprintk("RPC: %s: ib_destroy_cq returned %i\n",
784781
__func__, rc);
785-
786-
return rc;
787782
}
788783

789784
/*

net/sunrpc/xprtrdma/xprt_rdma.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ void rpcrdma_ia_close(struct rpcrdma_ia *);
301301
*/
302302
int rpcrdma_ep_create(struct rpcrdma_ep *, struct rpcrdma_ia *,
303303
struct rpcrdma_create_data_internal *);
304-
int rpcrdma_ep_destroy(struct rpcrdma_ep *, struct rpcrdma_ia *);
304+
void rpcrdma_ep_destroy(struct rpcrdma_ep *, struct rpcrdma_ia *);
305305
int rpcrdma_ep_connect(struct rpcrdma_ep *, struct rpcrdma_ia *);
306306
int rpcrdma_ep_disconnect(struct rpcrdma_ep *, struct rpcrdma_ia *);
307307

0 commit comments

Comments
 (0)