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

drivers/w1/slaves/w1_ds250x.c:215: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: d835b3166dd6 ("w1: add DS2501, DS2502, DS2505 EPROM device driver")
CC: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Signed-off-by: kbuild test robot <lkp@intel.com>
---

url: https://github.com/0day-ci/linux/commits/Thomas-Bogendoerfer/w1-add-1-wire-master-driver-for-IP-block-found-in-SGI-ASICs/20190830-122322

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

--- a/drivers/w1/slaves/w1_ds250x.c
+++ b/drivers/w1/slaves/w1_ds250x.c
@@ -212,10 +212,7 @@ static int w1_eprom_add_slave(struct w1_
nvmem_cfg.size = data->size;

nvmem = devm_nvmem_register(&sl->dev, &nvmem_cfg);
- if (IS_ERR(nvmem))
- return PTR_ERR(nvmem);
-
- return 0;
+ return PTR_ERR_OR_ZERO(nvmem);
}

static struct w1_family_ops w1_eprom_fops = {
\
 
 \ /
  Last update: 2019-08-30 13:45    [W:0.067 / U:1.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site