[PATCH] rxrpc: fix ptr_ret.cocci warnings

STALE3709d

3 messages, 3 authors, 2016-06-09 · open the first message on its own page

[PATCH] rxrpc: fix ptr_ret.cocci warnings

From: kbuild test robot <hidden>
Date: 2016-06-04 23:18:50

net/rxrpc/rxkad.c:1165:1-3: WARNING: PTR_ERR_OR_ZERO can be used


 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

CC: David Howells <dhowells@redhat.com>
Signed-off-by: Fengguang Wu <redacted>
---

 rxkad.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
--- a/net/rxrpc/rxkad.c
+++ b/net/rxrpc/rxkad.c
@@ -1162,9 +1162,7 @@ static int rxkad_init(void)
 	/* pin the cipher we need so that the crypto layer doesn't invoke
 	 * keventd to go get it */
 	rxkad_ci = crypto_alloc_skcipher("pcbc(fcrypt)", 0, CRYPTO_ALG_ASYNC);
-	if (IS_ERR(rxkad_ci))
-		return PTR_ERR(rxkad_ci);
-	return 0;
+	return PTR_ERR_OR_ZERO(rxkad_ci);
 }
 
 /*

Re: [PATCH] rxrpc: fix ptr_ret.cocci warnings

From: David Miller <davem@davemloft.net>
Date: 2016-06-07 22:30:39

From: kbuild test robot <redacted>
Date: Sun, 5 Jun 2016 07:17:19 +0800
net/rxrpc/rxkad.c:1165:1-3: WARNING: PTR_ERR_OR_ZERO can be used


 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

CC: David Howells <dhowells@redhat.com>
Signed-off-by: Fengguang Wu <redacted>
Applied.

Re: [PATCH] rxrpc: fix ptr_ret.cocci warnings

From: David Howells <dhowells@redhat.com>
Date: 2016-06-09 14:38:40

kbuild test robot [off-list ref] wrote:
net/rxrpc/rxkad.c:1165:1-3: WARNING: PTR_ERR_OR_ZERO can be used


 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

CC: David Howells <dhowells@redhat.com>
Signed-off-by: Fengguang Wu <redacted>
Acked-by: David Howells <dhowells@redhat.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help