Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp975087pxb; Mon, 25 Oct 2021 23:56:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZ4cQPUsqAx9aew10X0zRnpAlp7zqttAtr0uGMOuKTwRc8ygsRBwLCUelJRiEaE0AFOXdW X-Received: by 2002:a05:6402:170e:: with SMTP id y14mr1543064edu.292.1635231410390; Mon, 25 Oct 2021 23:56:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635231410; cv=none; d=google.com; s=arc-20160816; b=Pg9pT+6UusIb8O+3+dHKnOgrZvd648zpzbsQgnnliaE/wtOmtPJ6UY5xTs6ThKMdOi q1pgg4MSjzd7sVOy5eIoaTskJEgUPaC16QqkpezvKluoYpE7XEPXPIgdKXPD36O7LAzr uvqj7XZwucOHdl5vbyPSm/PCxyWHpQCata676iyemwrz7IWlgYZI/gsT1es/WaJucOJk WqYfjUoBQ4Nq25pn0IPHS4bg97Z4LNEwkhzvQNUpsZ5Z0zabVMHFu+ureCSV+ih8glCW y10rVSdZIJUlmmCDmcuE/0d352kt6SJimuIiYWsVOMebsiZuJlBo3Ug/DYnD+Euq+QQI dHvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=nv7429b3YFnMMLjsyy5XPSIgwc1uGddRZd1qlai8p80=; b=F/3dblMcW1y0ILDqYKfktMmGiBlEaMWSEhX9Fp73YOFAe/uGM1CIDzwvNlpCM5eTpG 8xvaUcPyFwehqJS2wB2gfIK9B7JhwzG/+D/8FJUcpOmxwh2YGAFrS3It8TUM+pEvLkc6 DhG8/H68LHA3+i5voxsPoic/dqDvid0JfxrSqe/eYw0/a+zeXipFYUksRWixjsgdQH9Y OXJwQOyUjc3RRyy7uyTslnMmyzOQ8Oxji5nUrL+Z4FG8owr1QDY0RmwCKB+/4t0Uqyew vKnN7DbmRykjUjjDiU5jM0zN+a+Vp/QaAum7q1wtIYKKR30zVtrYrAnt/gui0jf84Jjc IiEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mp18si34402858ejc.505.2021.10.25.23.56.22; Mon, 25 Oct 2021 23:56:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234634AbhJZDai (ORCPT + 99 others); Mon, 25 Oct 2021 23:30:38 -0400 Received: from smtp25.cstnet.cn ([159.226.251.25]:45050 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233728AbhJZDah (ORCPT ); Mon, 25 Oct 2021 23:30:37 -0400 Received: from localhost.localdomain (unknown [124.16.138.128]) by APP-05 (Coremail) with SMTP id zQCowAAH6u61dXdhPPotBQ--.46973S2; Tue, 26 Oct 2021 11:27:50 +0800 (CST) From: Jiasheng Jiang To: boris.ostrovsky@oracle.com, jgross@suse.com, sstabellini@kernel.org Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, Jiasheng Jiang Subject: [PATCH] xen: Fix implicit type conversion Date: Tue, 26 Oct 2021 03:27:48 +0000 Message-Id: <1635218868-2437564-1-git-send-email-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.7.4 X-CM-TRANSID: zQCowAAH6u61dXdhPPotBQ--.46973S2 X-Coremail-Antispam: 1UD129KBjvdXoWruw18Xr43urW8Gr4Uuw43trb_yoWDtFbE9r s0qr1xXrWvvF1qvayUKw4fZFW09w1xuayfXw1qg39xAw1Sqr47Xryjqr93Xw17GrWIyFsr Zw17Xr1xAryUGjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbcAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_ Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr 0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj 6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr 0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxkIecxEwVAFwVW8 GwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r 1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij 64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr 0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6rW3Jr0E3s1lIxAIcVC2z280aVAFwI0_Jr0_Gr1l IxAIcVC2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjfU84SoDUUUU X-Originating-IP: [124.16.138.128] X-CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; int rc; if (!xen_initial_domain()) -- 2.7.4