Skip to content

Commit cbd5458

Browse files
JiangJiasbostrovs
authored andcommitted
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: 3fac101 ("xen: Re-upload processor PM data to hypervisor after S3 resume (v2)") Signed-off-by: Jiasheng Jiang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Juergen Gross <[email protected]> Reviewed-by: Jiamei Xie <[email protected]> Signed-off-by: Boris Ostrovsky <[email protected]>
1 parent 9e2b3e8 commit cbd5458

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/xen/xen-acpi-processor.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ static struct acpi_processor_performance __percpu *acpi_perf_data;
450450

451451
static void free_acpi_perf_data(void)
452452
{
453-
unsigned int i;
453+
int i;
454454

455455
/* Freeing a NULL pointer is OK, and alloc_percpu zeroes. */
456456
for_each_possible_cpu(i)
@@ -462,7 +462,7 @@ static void free_acpi_perf_data(void)
462462
static int xen_upload_processor_pm_data(void)
463463
{
464464
struct acpi_processor *pr_backup = NULL;
465-
unsigned int i;
465+
int i;
466466
int rc = 0;
467467

468468
pr_info("Uploading Xen processor PM info\n");
@@ -518,7 +518,7 @@ static struct syscore_ops xap_syscore_ops = {
518518

519519
static int __init xen_acpi_processor_init(void)
520520
{
521-
unsigned int i;
521+
int i;
522522
int rc;
523523

524524
if (!xen_initial_domain())

0 commit comments

Comments
 (0)