mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] xprtrdma: Delete an error message for a failed memory allocation in xprt_rdma_bc_setup()
@ 2017-05-22 20:24 SF Markus Elfring
  2017-05-22 20:31 ` Chuck Lever
  0 siblings, 1 reply; 2+ messages in thread
From: SF Markus Elfring @ 2017-05-22 20:24 UTC (permalink / raw)
  To: linux-nfs, netdev, Anna Schumaker, Chuck Lever, David S. Miller,
	J. Bruce Fields, Jeff Layton, Trond Myklebust
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 22 May 2017 22:18:28 +0200

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 net/sunrpc/xprtrdma/backchannel.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/sunrpc/xprtrdma/backchannel.c b/net/sunrpc/xprtrdma/backchannel.c
index 24fedd4b117e..03f6b5840764 100644
--- a/net/sunrpc/xprtrdma/backchannel.c
+++ b/net/sunrpc/xprtrdma/backchannel.c
@@ -119,11 +119,9 @@ int xprt_rdma_bc_setup(struct rpc_xprt *xprt, unsigned int reqs)
 
 	for (i = 0; i < (reqs << 1); i++) {
 		rqst = kzalloc(sizeof(*rqst), GFP_KERNEL);
-		if (!rqst) {
-			pr_err("RPC:       %s: Failed to create bc rpc_rqst\n",
-			       __func__);
+		if (!rqst)
 			goto out_free;
-		}
+
 		dprintk("RPC:       %s: new rqst %p\n", __func__, rqst);
 
 		rqst->rq_xprt = &r_xprt->rx_xprt;
-- 
2.13.0

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

* Re: [PATCH] xprtrdma: Delete an error message for a failed memory allocation in xprt_rdma_bc_setup()
  2017-05-22 20:24 [PATCH] xprtrdma: Delete an error message for a failed memory allocation in xprt_rdma_bc_setup() SF Markus Elfring
@ 2017-05-22 20:31 ` Chuck Lever
  0 siblings, 0 replies; 2+ messages in thread
From: Chuck Lever @ 2017-05-22 20:31 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: Linux NFS Mailing List, netdev, Anna Schumaker, David S. Miller,
	J. Bruce Fields, Jeff Layton, Trond Myklebust, LKML,
	kernel-janitors


> On May 22, 2017, at 4:24 PM, SF Markus Elfring <elfring@users.sourceforge.net> wrote:
> 
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 22 May 2017 22:18:28 +0200
> 
> Omit an extra message for a memory allocation failure in this function.
> 
> This issue was detected by using the Coccinelle software.
> 
> Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Reviewed-by: Chuck Lever <chuck.lever@oracle.com>


> ---
> net/sunrpc/xprtrdma/backchannel.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/net/sunrpc/xprtrdma/backchannel.c b/net/sunrpc/xprtrdma/backchannel.c
> index 24fedd4b117e..03f6b5840764 100644
> --- a/net/sunrpc/xprtrdma/backchannel.c
> +++ b/net/sunrpc/xprtrdma/backchannel.c
> @@ -119,11 +119,9 @@ int xprt_rdma_bc_setup(struct rpc_xprt *xprt, unsigned int reqs)
> 
> 	for (i = 0; i < (reqs << 1); i++) {
> 		rqst = kzalloc(sizeof(*rqst), GFP_KERNEL);
> -		if (!rqst) {
> -			pr_err("RPC:       %s: Failed to create bc rpc_rqst\n",
> -			       __func__);
> +		if (!rqst)
> 			goto out_free;
> -		}
> +
> 		dprintk("RPC:       %s: new rqst %p\n", __func__, rqst);
> 
> 		rqst->rq_xprt = &r_xprt->rx_xprt;
> -- 
> 2.13.0

--
Chuck Lever

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

end of thread, other threads:[~2017-05-22 20:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-22 20:24 [PATCH] xprtrdma: Delete an error message for a failed memory allocation in xprt_rdma_bc_setup() SF Markus Elfring
2017-05-22 20:31 ` Chuck Lever

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®