]> git.baikalelectronics.ru Git - kernel.git/commit
xen: Fix implicit type conversion
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Tue, 26 Oct 2021 07:32:11 +0000 (07:32 +0000)
committerBoris Ostrovsky <boris.ostrovsky@oracle.com>
Tue, 2 Nov 2021 12:45:44 +0000 (07:45 -0500)
commitf70bfc271a3e7bd18b2e0722fd8fb4f1ac79f4b1
tree839c5cad21a22db77d99bad4c77298f717478a83
parent0a9d2b7c167d2dba921f4728b581b591c7a9ffb4
xen: Fix implicit type conversion

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 converted 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.

[boris: fixed commit message formatting]

Fixes: 48019e341805 ("xen: Re-upload processor PM data to hypervisor after S3 resume (v2)")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Link: https://lore.kernel.org/r/1635233531-2437704-1-git-send-email-jiasheng@iscas.ac.cn
Reviewed-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jiamei Xie <jiamei.xie@arm.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
drivers/xen/xen-acpi-processor.c