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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 26 Oct 2021 09:13:43 +0200
From:   Juergen Gross <jgross@...e.com>
To:     Jiasheng Jiang <jiasheng@...as.ac.cn>, boris.ostrovsky@...cle.com,
        sstabellini@...nel.org
Cc:     xen-devel@...ts.xenproject.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] xen: Fix implicit type conversion

On 26.10.21 05:27, Jiasheng Jiang wrote:
> The variable 'i' is defined as UINT.
> However in the for_each_possible_cpu, its value is assigned to -1.
> That doesn't make sense and 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 definition of 'i' from UINT
> to INT.
> 
> Fixes: 3fac101 ("xen: Re-upload processor PM data to hypervisor after S3 resume (v2)")
> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
> ---
>   drivers/xen/xen-acpi-processor.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/xen/xen-acpi-processor.c b/drivers/xen/xen-acpi-processor.c
> index df7cab8..2551691 100644
> --- a/drivers/xen/xen-acpi-processor.c
> +++ b/drivers/xen/xen-acpi-processor.c
> @@ -518,7 +518,7 @@ static struct syscore_ops xap_syscore_ops = {
>   
>   static int __init xen_acpi_processor_init(void)
>   {
> -	unsigned int i;
> +	int i;

I agree with the approach, but could you please fix all the other
similar issues in that file, please?

The same should be done in free_acpi_perf_data() and in
xen_upload_processor_pm_data().


Juergen

Download attachment "OpenPGP_0xB0DE9DD628BF132F.asc" of type "application/pgp-keys" (3092 bytes)

Download attachment "OpenPGP_signature" of type "application/pgp-signature" (496 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ