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-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0i=w5fgJ9r0or1gi-akz7s-6dU4uLZZ7kAcwetVpA1CHQ@mail.gmail.com>
Date: Sun, 1 Feb 2026 14:02:12 +0100
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Sumeet Pawnikar <sumeet4linux@...il.com>
Cc: rafael@...nel.org, daniel.lezcano@...aro.org, rui.zhang@...el.com, 
	linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drivers: thermal: intel: tcc_cooling: remove unused variable

On Sat, Jan 31, 2026 at 4:16 PM Sumeet Pawnikar <sumeet4linux@...il.com> wrote:
>
> 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;
>  }
>
> --

Applied as 6.20/7.0 material with some adjustments, thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ