From: Julia Lawall <julia.lawall@lip6.fr>
To: "Stephan Müller" <smueller@chronox.de>
Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
"Jason A. Donenfeld" <Jason@zx2c4.com>,
kbuild-all@01.org
Subject: [PATCH] fix ptr_ret.cocci warnings
Date: Mon, 15 May 2017 18:52:11 +0800 (SGT) [thread overview]
Message-ID: <alpine.DEB.2.20.1705151850590.4315@hadrien> (raw)
[-- Attachment #1: Type: text/plain, Size: 876 bytes --]
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@chronox.de>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.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 ***************************/
next reply other threads:[~2017-05-15 10:52 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-15 10:52 Julia Lawall [this message]
2017-05-15 10:56 ` [PATCH] fix ptr_ret.cocci warnings Stephan Müller
-- strict thread matches above, loose matches on Subject: below --
2020-08-27 1:41 [ebiggers:cryptobench 1/1] crypto/benchmark.c:616:1-3: WARNING: PTR_ERR_OR_ZERO can be used kernel test robot
2020-08-27 1:41 ` [PATCH] fix ptr_ret.cocci warnings kernel test robot
2019-12-21 1:18 drivers/pci/controller/pcie-rockchip-host.c:628:1-3: WARNING: PTR_ERR_OR_ZERO can be used kbuild test robot
2019-12-21 1:18 ` [PATCH] fix ptr_ret.cocci warnings kbuild test robot
2019-12-21 1:18 ` kbuild test robot
2019-12-21 1:18 ` kbuild test robot
2019-10-09 11:32 [wsa:renesas/i2c/new_dummy 5/5] drivers/i2c/busses/i2c-nvidia-gpu.c:284:1-3: WARNING: PTR_ERR_OR_ZERO can be used kbuild test robot
2019-10-09 11:32 ` [PATCH] fix ptr_ret.cocci warnings kbuild test robot
2018-10-24 19:58 [PATCH v2 10/13] NFS inter ssc open Olga Kornievskaia
2018-10-25 1:31 ` [PATCH] fix ptr_ret.cocci warnings kbuild test robot
2017-03-17 14:48 [PATCH v8 3/3] backlight arcxcnn add support for ArcticSand devices kbuild test robot
2017-03-15 19:45 ` Olimpiu Dejeu
[not found] ` <1489607133-7870-3-git-send-email-olimpiu-eV7fy4qpoLhpLGFMi4vTTA@public.gmane.org>
2017-03-17 14:48 ` [PATCH] fix ptr_ret.cocci warnings kbuild test robot
2017-03-17 14:48 ` kbuild test robot
2017-03-17 14:48 ` kbuild test robot
[not found] ` <20170317144809.GA103304-zqhkPGYYkloFTpe94t1N+dh3ngVCH38I@public.gmane.org>
2017-03-21 14:58 ` Olimpiu Dejeu
2017-03-21 14:58 ` Olimpiu Dejeu
2017-03-21 14:58 ` Olimpiu Dejeu
[not found] ` <CAF-XLWL6KODEkqjN58abz2ieywgZ0BO5enHQJ2jSD5WpX+NSaQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-21 15:07 ` Daniel Thompson
2017-03-21 15:07 ` Daniel Thompson
2017-03-21 15:07 ` Daniel Thompson
2017-04-17 12:57 ` Olimpiu Dejeu
[not found] ` <CAF-XLWL_w3OqafbLzcM=kOkS1nPb0VSCAyDaudQh2UwE4Gw0gg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-24 10:57 ` Lee Jones
2017-04-24 10:57 ` Lee Jones
2017-04-24 10:57 ` Lee Jones
2017-04-24 11:26 ` Daniel Thompson
2017-04-24 11:26 ` Daniel Thompson
2015-06-24 15:00 [nfs:testing 41/50] fs/nfs/nfs42proc.c:191:1-3: WARNING: PTR_ERR_OR_ZERO can be used kbuild test robot
2015-06-24 15:00 ` [PATCH] fix ptr_ret.cocci warnings kbuild test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.20.1705151850590.4315@hadrien \
--to=julia.lawall@lip6.fr \
--cc=Jason@zx2c4.com \
--cc=kbuild-all@01.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=smueller@chronox.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.