Skip to content

Commit

Permalink
rxrpc: fix ptr_ret.cocci warnings
Browse files Browse the repository at this point in the history
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 <fengguang.wu@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wu Fengguang authored and David S. Miller committed Jun 7, 2016
1 parent 29a3661 commit fa54cc7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/rxrpc/rxkad.c
Original file line number Diff line number Diff line change
@@ -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);
}

/*

0 comments on commit fa54cc7

Please sign in to comment.