netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v1] sunrpc: xprtrdma: Use ERR_CAST() to return
@ 2024-08-30  1:43 Yan Zhen
  2024-08-30 14:33 ` Chuck Lever
  0 siblings, 1 reply; 2+ messages in thread
From: Yan Zhen @ 2024-08-30  1:43 UTC (permalink / raw)
  To: trondmy, anna, chuck.lever, jlayton, davem, edumazet, kuba,
	pabeni
  Cc: neilb, okorniev, Dai.Ngo, tom, linux-nfs, netdev, linux-kernel,
	opensource.kernel, Yan Zhen

Using ERR_CAST() is more reasonable and safer, When it is necessary
to convert the type of an error pointer and return it.

Signed-off-by: Yan Zhen <yanzhen@vivo.com>
---
 net/sunrpc/xprtrdma/svc_rdma_transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
index 581cc5ed7c0c..c3fbf0779d4a 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
@@ -369,7 +369,7 @@ static struct svc_xprt *svc_rdma_create(struct svc_serv *serv,
 	listen_id = svc_rdma_create_listen_id(net, sa, cma_xprt);
 	if (IS_ERR(listen_id)) {
 		kfree(cma_xprt);
-		return (struct svc_xprt *)listen_id;
+		return ERR_CAST(listen_id);
 	}
 	cma_xprt->sc_cm_id = listen_id;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next v1] sunrpc: xprtrdma: Use ERR_CAST() to return
  2024-08-30  1:43 [PATCH net-next v1] sunrpc: xprtrdma: Use ERR_CAST() to return Yan Zhen
@ 2024-08-30 14:33 ` Chuck Lever
  0 siblings, 0 replies; 2+ messages in thread
From: Chuck Lever @ 2024-08-30 14:33 UTC (permalink / raw)
  To: Yan Zhen
  Cc: trondmy@kernel.org, anna@kernel.org, jlayton@kernel.org,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, neilb@suse.de, okorniev@redhat.com, Dai Ngo,
	tom@talpey.com, linux-nfs@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, opensource.kernel@vivo.com

On Fri, 30 Aug 2024 09:43:56 +0800, Yan Zhen wrote:
> Using ERR_CAST() is more reasonable and safer, When it is necessary
> to convert the type of an error pointer and return it.
> 
> 

Applied to nfsd-next for v6.12, thanks!

[1/1] sunrpc: xprtrdma: Use ERR_CAST() to return
      commit: a1499a6890cd3551e9b04c3ec55774236188cc62

-- 
Chuck Lever

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-30 14:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-30  1:43 [PATCH net-next v1] sunrpc: xprtrdma: Use ERR_CAST() to return Yan Zhen
2024-08-30 14:33 ` Chuck Lever

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).