mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fix ptr_ret.cocci warnings
@ 2017-05-15 10:52 Julia Lawall
  2017-05-15 10:56 ` Stephan Müller
  0 siblings, 1 reply; 8+ messages in thread
From: Julia Lawall @ 2017-05-15 10:52 UTC (permalink / raw)
  To: Stephan Müller
  Cc: linux-kernel, linux-crypto, Jason A. Donenfeld, kbuild-all

[-- 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 ***************************/

^ permalink raw reply	[flat|nested] 8+ messages in thread
* drivers/pci/controller/pcie-rockchip-host.c:628:1-3: WARNING: PTR_ERR_OR_ZERO can be used
@ 2019-12-21  1:18 kbuild test robot
  2019-12-21  1:18 ` [PATCH] fix ptr_ret.cocci warnings kbuild test robot
  0 siblings, 1 reply; 8+ messages in thread
From: kbuild test robot @ 2019-12-21  1:18 UTC (permalink / raw)
  To: Lorenzo Pieralisi; +Cc: kbuild-all, linux-kernel, Bjorn Helgaas

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b371ddb94fae82b6565020639b7db31934043c65
commit: 069ade5dfec93dd2916a85df8b1bab2d578857bd Merge branch 'remotes/lorenzo/pci/rockchip'
date:   3 weeks ago

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>


coccinelle warnings: (new ones prefixed by >>)

>> drivers/pci/controller/pcie-rockchip-host.c:628:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Please review and possibly fold the followup patch.

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [PATCH v8 3/3] backlight arcxcnn add support for ArcticSand devices
  2017-03-15 19:45 ` Olimpiu Dejeu
@ 2017-03-17 14:48 kbuild test robot
  2017-03-15 19:45 ` Olimpiu Dejeu
  0 siblings, 1 reply; 8+ messages in thread
From: kbuild test robot @ 2017-03-17 14:48 UTC (permalink / raw)
  To: Olimpiu Dejeu
  Cc: kbuild-all, robh, lee.jones, linux-kernel, linux-fbdev,
	devicetree, jingoohan1, bdodge, joe, medasaro, daniel.thompson,
	Olimpiu Dejeu

Hi Olimpiu,

[auto build test WARNING on robh/for-next]
[also build test WARNING on v4.11-rc2 next-20170310]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Olimpiu-Dejeu/backlight-arcxcnn-add-arc-to-vendor-prefix/20170317-205447
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next


coccinelle warnings: (new ones prefixed by >>)

>> drivers/video/backlight/arcxcnn_bl.c:183:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Please review and possibly fold the followup patch.

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-12-21  1:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-15 10:52 [PATCH] fix ptr_ret.cocci warnings Julia Lawall
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

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®