lkml.org 
[lkml]   [2017]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] drivers: hwmon: fix ptr_ret.cocci warnings
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

CC: Jaghathiswari Rankappagounder Natarajan <jaghu@google.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

aspeed-pwm-tacho.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/hwmon/aspeed-pwm-tacho.c
+++ b/drivers/hwmon/aspeed-pwm-tacho.c
@@ -855,10 +855,7 @@ static int aspeed_pwm_tacho_probe(struct
hwmon = devm_hwmon_device_register_with_groups(&pdev->dev,
"aspeed_pwm_tacho",
priv, priv->groups);
- if (IS_ERR(hwmon))
- return PTR_ERR(hwmon);
-
- return 0;
+ return PTR_ERR_OR_ZERO(hwmon);
}

static const struct of_device_id of_pwm_tacho_match_table[] = {
\
 
 \ /
  Last update: 2017-01-10 06:50    [W:0.197 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site