All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paran Lee <p4ranlee@gmail.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: Austin Kim <austindh.kim@gmail.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: [PATCH] xen/arm: silence ambiguous integer casting warning error
Date: Wed, 20 Apr 2022 00:41:26 +0900	[thread overview]
Message-ID: <20220419154126.GA1518@DESKTOP-NK4TH6S.localdomain> (raw)

GCC with "-g -Wall -Wextra" option throws warning message as below:

error: comparison of integer expressions of different signedness:
 ‘int’ and ‘unsigned int’ [-Werror=sign-compare]

Silence the warning by correcting the integer type.

Signed-off-by: Paran Lee <p4ranlee@gmail.com>
---
 xen/arch/arm/gic-v3.c | 5 +++--
 xen/arch/arm/setup.c  | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 3c472ed768..81ac25f528 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -916,7 +916,8 @@ static void gicv3_hyp_disable(void)
     isb();
 }
 
-static u16 gicv3_compute_target_list(int *base_cpu, const struct cpumask *mask,
+static u16 gicv3_compute_target_list(unsigned int *base_cpu,
+                                     const struct cpumask *mask,
                                      uint64_t cluster_id)
 {
     int cpu = *base_cpu;
@@ -953,7 +954,7 @@ out:
 
 static void gicv3_send_sgi_list(enum gic_sgi sgi, const cpumask_t *cpumask)
 {
-    int cpu = 0;
+    unsigned int cpu = 0;
     uint64_t val;
 
     for_each_cpu(cpu, cpumask)
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index d5d0792ed4..5ab2aaecaf 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -862,7 +862,7 @@ void __init start_xen(unsigned long boot_phys_offset,
                       unsigned long fdt_paddr)
 {
     size_t fdt_size;
-    int cpus, i;
+    unsigned int cpus, i;
     const char *cmdline;
     struct bootmodule *xen_bootmodule;
     struct domain *d;
-- 
2.25.1



             reply	other threads:[~2022-04-19 15:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19 15:41 Paran Lee [this message]
2022-04-19 15:50 ` [PATCH] xen/arm: silence ambiguous integer casting warning error Julien Grall
2022-04-19 16:31   ` Paran Lee
2022-04-19 16:50     ` Julien Grall
2022-04-19 17:09     ` Paran Lee
2022-04-19 17:31       ` Julien Grall
2022-04-21 15:07         ` Paran Lee
2022-04-22  0:03 ` Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220419154126.GA1518@DESKTOP-NK4TH6S.localdomain \
    --to=p4ranlee@gmail.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=austindh.kim@gmail.com \
    --cc=bertrand.marquis@arm.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.