lkml.org 
[lkml]   [2020]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] rtc: pcf8523: fix ptr_ret.cocci warnings
From: kbuild test robot <lkp@intel.com>

drivers/rtc/rtc-pcf8523.c:361: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

Fixes: 93966243cf90 ("rtc: pcf8523: Remove struct pcf8523")
CC: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: kbuild test robot <lkp@intel.com>
---

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 3a562aee727a7bfbb3a37b1aa934118397dad701
commit: 93966243cf90c055d89b5ebfbb8dee0f9ac6b0a2 rtc: pcf8523: Remove struct pcf8523

rtc-pcf8523.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/rtc/rtc-pcf8523.c
+++ b/drivers/rtc/rtc-pcf8523.c
@@ -358,10 +358,7 @@ static int pcf8523_probe(struct i2c_clie

rtc = devm_rtc_device_register(&client->dev, DRIVER_NAME,
&pcf8523_rtc_ops, THIS_MODULE);
- if (IS_ERR(rtc))
- return PTR_ERR(rtc);
-
- return 0;
+ return PTR_ERR_OR_ZERO(rtc);
}

static const struct i2c_device_id pcf8523_id[] = {
\
 
 \ /
  Last update: 2020-01-04 18:14    [W:0.030 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site