mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
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>
This commit is contained in:
parent
9635c586a5
commit
9eb9c350bc
|
|
@ -76,10 +76,8 @@ MODULE_DEVICE_TABLE(x86cpu, tcc_ids);
|
|||
|
||||
static int __init tcc_cooling_init(void)
|
||||
{
|
||||
int ret;
|
||||
u64 val;
|
||||
const struct x86_cpu_id *id;
|
||||
|
||||
int err;
|
||||
|
||||
id = x86_match_cpu(tcc_ids);
|
||||
|
|
@ -107,10 +105,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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user