diff mbox

nvmem: meson-mx-efuse: fix ptr_ret.cocci warnings

Message ID 20180304111333.GA24937@lkp-hsx02 (mailing list archive)
State New, archived
Headers show

Commit Message

kernel test robot March 4, 2018, 11:13 a.m. UTC
From: Fengguang Wu <fengguang.wu@intel.com>

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

 meson-mx-efuse.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox

Patch

--- a/drivers/nvmem/meson-mx-efuse.c
+++ b/drivers/nvmem/meson-mx-efuse.c
@@ -234,10 +234,7 @@  static int meson_mx_efuse_probe(struct p
 	}
 
 	efuse->nvmem = devm_nvmem_register(&pdev->dev, &efuse->config);
-	if (IS_ERR(efuse->nvmem))
-		return PTR_ERR(efuse->nvmem);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(efuse->nvmem);
 }
 
 static struct platform_driver meson_mx_efuse_driver = {