[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1705151850590.4315@hadrien>
Date: Mon, 15 May 2017 18:52:11 +0800 (SGT)
From: Julia Lawall <julia.lawall@...6.fr>
To: Stephan Müller <smueller@...onox.de>
cc: linux-kernel@...r.kernel.org, linux-crypto@...r.kernel.org,
"Jason A. Donenfeld" <Jason@...c4.com>, kbuild-all@...org
Subject: [PATCH] fix ptr_ret.cocci warnings
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
Generated by: scripts/coccinelle/api/ptr_ret.cocci
CC: Stephan Müller <smueller@...onox.de>
Signed-off-by: Julia Lawall <julia.lawall@...6.fr>
Signed-off-by: Fengguang Wu <fengguang.wu@...el.com>
---
Not very important, but the code can be a little simpler.
lrng_base.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- a/drivers/char/lrng_base.c
+++ b/drivers/char/lrng_base.c
@@ -1523,10 +1523,7 @@ static int lrng_alloc(void)
lrng_init_rng(key, sizeof(key));
lrng_pool.lrng_hash = lrng_hash_alloc(LRNG_HASH_NAME, key, sizeof(key));
memzero_explicit(key, sizeof(key));
- if (IS_ERR(lrng_pool.lrng_hash))
- return PTR_ERR(lrng_pool.lrng_hash);
-
- return 0;
+ return PTR_ERR_OR_ZERO(lrng_pool.lrng_hash);
}
/************************** LRNG kernel interfaces ***************************/
Powered by blists - more mailing lists