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]
Date:   Fri, 29 Oct 2021 18:08:48 +0200
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Jiasheng Jiang <jiasheng@...as.ac.cn>
Cc:     "Zhang, Rui" <rui.zhang@...el.com>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        Amit Kucheria <amitk@...nel.org>,
        Linux PM <linux-pm@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] thermal: Fix implicit type conversion

On Thu, Oct 28, 2021 at 5:22 AM Jiasheng Jiang <jiasheng@...as.ac.cn> wrote:
>
> The parameter 'cpu' is defined as unsigned int.
> However in the cpumask_next() it is implicitly type conversed
> to int.
> It is universally accepted that the implicit type conversion is
> terrible.
> Also, having the good programming custom will set an example for
> others.
> Thus, it might be better to change the type of 'cpu' from
> unsigned int to int.
>
> Fixes: 3e8c4d3 ("drivers: thermal: Move various drivers for intel platforms into a subdir")
> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
> ---
>  drivers/thermal/intel/intel_powerclamp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/intel/intel_powerclamp.c b/drivers/thermal/intel/intel_powerclamp.c
> index b0eb5ec..ed46b5e 100644
> --- a/drivers/thermal/intel/intel_powerclamp.c
> +++ b/drivers/thermal/intel/intel_powerclamp.c
> @@ -578,7 +578,7 @@ static int powerclamp_cpu_online(unsigned int cpu)
>         return 0;
>  }
>
> -static int powerclamp_cpu_predown(unsigned int cpu)
> +static int powerclamp_cpu_predown(int cpu)
>  {
>         if (clamping == false)
>                 return 0;
> --

I'm not going to consider any patches of this type, because IMO they
are not improvements.

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ