Skip to content

Commit 9eb9c35

Browse files
sumeet4linuxrafaeljw
authored andcommitted
drivers: thermal: intel: tcc_cooling: Drop redundant local variable
Simplify the error path by directly returning PTR_ERR(tcc_cdev) instead of storing it in an intermediate variable ret which can be dropped then because it is only used for that. Also remove an uneeded empty line before the declaration of local variable err. Signed-off-by: Sumeet Pawnikar <sumeet4linux@gmail.com> [ rjw: Dropped unneeded changes, rewrote changelog, adjusted subject ] Link: https://patch.msgid.link/20260131151615.6230-1-sumeet4linux@gmail.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 9635c58 commit 9eb9c35

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

drivers/thermal/intel/intel_tcc_cooling.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,8 @@ MODULE_DEVICE_TABLE(x86cpu, tcc_ids);
7676

7777
static int __init tcc_cooling_init(void)
7878
{
79-
int ret;
8079
u64 val;
8180
const struct x86_cpu_id *id;
82-
8381
int err;
8482

8583
id = x86_match_cpu(tcc_ids);
@@ -107,10 +105,9 @@ static int __init tcc_cooling_init(void)
107105
tcc_cdev =
108106
thermal_cooling_device_register("TCC Offset", NULL,
109107
&tcc_cooling_ops);
110-
if (IS_ERR(tcc_cdev)) {
111-
ret = PTR_ERR(tcc_cdev);
112-
return ret;
113-
}
108+
if (IS_ERR(tcc_cdev))
109+
return PTR_ERR(tcc_cdev);
110+
114111
return 0;
115112
}
116113

0 commit comments

Comments
 (0)