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>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260131151615.6230-1-sumeet4linux@gmail.com>
Date: Sat, 31 Jan 2026 20:46:15 +0530
From: Sumeet Pawnikar <sumeet4linux@...il.com>
To: rafael@...nel.org,
	daniel.lezcano@...aro.org,
	rui.zhang@...el.com,
	linux-pm@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
	sumeet4linux@...il.com
Subject: [PATCH] drivers: thermal: intel: tcc_cooling: remove unused variable

Remove the unused variable 'ret' in tcc_cooling_init() and simplify the
error handling path. The variable 'ret' was declared but only used to
store the return value of PTR_ERR(tcc_cdev) before immediately returning
it, which is redundant.

Remove the duplicate variable declaration where both 'ret' and 'err' were
declared, but only 'err' was actually needed.
Also, simplify the error path by directly returning PTR_ERR(tcc_cdev)
instead of storing it in an intermediate variable.

Signed-off-by: Sumeet Pawnikar <sumeet4linux@...il.com>
---
 drivers/thermal/intel/intel_tcc_cooling.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/thermal/intel/intel_tcc_cooling.c b/drivers/thermal/intel/intel_tcc_cooling.c
index f352ecafbedf..a5b31b25225e 100644
--- a/drivers/thermal/intel/intel_tcc_cooling.c
+++ b/drivers/thermal/intel/intel_tcc_cooling.c
@@ -72,12 +72,10 @@ MODULE_DEVICE_TABLE(x86cpu, tcc_ids);
 
 static int __init tcc_cooling_init(void)
 {
-	int ret;
+	int err;
 	u64 val;
 	const struct x86_cpu_id *id;
 
-	int err;
-
 	id = x86_match_cpu(tcc_ids);
 	if (!id)
 		return -ENODEV;
@@ -103,10 +101,9 @@ static int __init tcc_cooling_init(void)
 	tcc_cdev =
 	    thermal_cooling_device_register("TCC Offset", NULL,
 					    &tcc_cooling_ops);
-	if (IS_ERR(tcc_cdev)) {
-		ret = PTR_ERR(tcc_cdev);
-		return ret;
-	}
+	if (IS_ERR(tcc_cdev))
+		return PTR_ERR(tcc_cdev);
+
 	return 0;
 }
 
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ