lkml.org 
[lkml]   [2018]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] nvmem: uniphier-efuse: fix ptr_ret.cocci warnings
From: Fengguang Wu <fengguang.wu@intel.com>

drivers/nvmem/uniphier-efuse.c:64: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: d562efb89f70 ("nvmem: uniphier-efuse: Convert to use devm_nvmem_register()")
CC: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

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

--- a/drivers/nvmem/uniphier-efuse.c
+++ b/drivers/nvmem/uniphier-efuse.c
@@ -61,10 +61,7 @@ static int uniphier_efuse_probe(struct p
econfig.priv = priv;
econfig.dev = dev;
nvmem = devm_nvmem_register(dev, &econfig);
- if (IS_ERR(nvmem))
- return PTR_ERR(nvmem);
-
- return 0;
+ return PTR_ERR_OR_ZERO(nvmem);
}

static const struct of_device_id uniphier_efuse_of_match[] = {
\
 
 \ /
  Last update: 2018-03-04 01:49    [W:0.589 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site