[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen/arm: silence ambiguous integer casting warning error



Hi,

On Tue, 19 Apr 2022, 15:41 Paran Lee, <p4ranlee@xxxxxxxxx> wrote:
GCC with "-g -Wall -Wextra" option throws warning message as below:

Which version of the compiler? Also you specify the exact cflags, did you tweak Xen?


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

GCC should give you a line/file. Can you provide it?

Cheers,


Silence the warning by correcting the integer type.

Signed-off-by: Paran Lee <p4ranlee@xxxxxxxxx>
---
 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.