lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20201004063755.GA47627@fe6c56ecaa6d>
Date:   Sun, 4 Oct 2020 14:37:55 +0800
From:   kernel test robot <lkp@...el.com>
To:     Naveen Krishna Chatradhi <nchatrad@....com>
Cc:     kbuild-all@...ts.01.org, linux-hwmon@...r.kernel.org,
        Guenter Roeck <linux@...ck-us.net>,
        Jean Delvare <jdelvare@...e.com>, linux-kernel@...r.kernel.org
Subject: [PATCH] hwmon: fix ptr_ret.cocci warnings

From: kernel test robot <lkp@...el.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@....com>
Signed-off-by: kernel test robot <lkp@...el.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)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ