lkml.org 
[lkml]   [2020]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] hwmon: fix ptr_ret.cocci warnings
From: kernel test robot <lkp@intel.com>

drivers/hwmon/amd_energy.c:302: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: 911766432fd2 ("hwmon: (amd_energy) Improve the accumulation logic")
CC: Naveen Krishna Chatradhi <nchatrad@amd.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
head: 78a28192e301da58ac408f2e98fa30aebafbfda0
commit: 911766432fd2a6054d9813845ad3f48120bd649c [45/55] hwmon: (amd_energy) Improve the accumulation logic

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

--- a/drivers/hwmon/amd_energy.c
+++ b/drivers/hwmon/amd_energy.c
@@ -299,10 +299,7 @@ static int amd_energy_probe(struct platf

data->wrap_accumulate = kthread_run(energy_accumulator, data,
"%s", dev_name(hwmon_dev));
- if (IS_ERR(data->wrap_accumulate))
- return PTR_ERR(data->wrap_accumulate);
-
- return 0;
+ return PTR_ERR_OR_ZERO(data->wrap_accumulate);
}

static int amd_energy_remove(struct platform_device *pdev)
\
 
 \ /
  Last update: 2020-10-04 08:39    [W:0.547 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site