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: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-15 10:52 Julia Lawall [this message]
2017-05-15 10:56 ` Stephan Müller
-- strict thread matches above, loose matches on Subject: below --
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
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
2017-03-17 14:48 ` [PATCH] fix ptr_ret.cocci warnings kbuild test robot
2017-03-21 14:58 ` Olimpiu Dejeu
2017-03-21 15:07 ` Daniel Thompson
[not found] ` <CAF-XLWL_w3OqafbLzcM=kOkS1nPb0VSCAyDaudQh2UwE4Gw0gg@mail.gmail.com>
2017-04-24 10:57 ` Lee Jones
2017-04-24 11:26 ` Daniel Thompson
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 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®