linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hwmon: fix ptr_ret.cocci warnings
  2020-10-04  6:37 [hwmon:hwmon-next 45/55] drivers/hwmon/amd_energy.c:302:1-3: WARNING: PTR_ERR_OR_ZERO can be used kernel test robot
@ 2020-10-04  6:37 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-10-04  6:37 UTC (permalink / raw)
  To: Naveen Krishna Chatradhi
  Cc: kbuild-all, linux-hwmon, Guenter Roeck, Jean Delvare,
	linux-kernel

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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [hwmon:hwmon-next 45/55] drivers/hwmon/amd_energy.c:302:1-3: WARNING: PTR_ERR_OR_ZERO can be used
@ 2020-10-04  6:37 kernel test robot
  2020-10-04  6:37 ` [PATCH] hwmon: fix ptr_ret.cocci warnings kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2020-10-04  6:37 UTC (permalink / raw)
  To: Naveen Krishna Chatradhi; +Cc: kbuild-all, linux-hwmon, Guenter Roeck

[-- Attachment #1: Type: text/plain, Size: 770 bytes --]

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
config: i386-randconfig-c001-20201004 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

	echo
	echo "coccinelle warnings: (new ones prefixed by >>)"
	echo
>> drivers/hwmon/amd_energy.c:302:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34715 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-04  6:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-04  6:37 [hwmon:hwmon-next 45/55] drivers/hwmon/amd_energy.c:302:1-3: WARNING: PTR_ERR_OR_ZERO can be used kernel test robot
2020-10-04  6:37 ` [PATCH] hwmon: fix ptr_ret.cocci warnings kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).