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

drivers/platform/chrome/wilco_ec/charge_config.c:173: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: 08c1b2e2e50e ("power_supply: platform/chrome: wilco_ec: Add charging config driver")
CC: Nick Crews <ncrews@chromium.org>
Signed-off-by: kbuild test robot <lkp@intel.com>
---

url: https://github.com/0day-ci/linux/commits/Nick-Crews/power_supply-Add-more-charge-types-and-CHARGE_CONTROL_-properties/20190412-211253

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

--- a/drivers/platform/chrome/wilco_ec/charge_config.c
+++ b/drivers/platform/chrome/wilco_ec/charge_config.c
@@ -170,10 +170,7 @@ static int wilco_charge_probe(struct pla

psy_cfg.drv_data = ec;
psy = devm_power_supply_register(&pdev->dev, &wilco_ps_desc, &psy_cfg);
- if (IS_ERR(psy))
- return PTR_ERR(psy);
-
- return 0;
+ return PTR_ERR_OR_ZERO(psy);
}

static struct platform_driver wilco_charge_driver = {
\
 
 \ /
  Last update: 2019-04-12 17:53    [W:0.056 / U:1.832 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site