]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm64: zynqmp: Fix compiler warnings in mp.c
authorVenkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Tue, 4 Oct 2022 05:34:54 +0000 (11:04 +0530)
committerMichal Simek <michal.simek@amd.com>
Fri, 7 Oct 2022 09:29:48 +0000 (11:29 +0200)
make W=1 generates the following warning in cpu_disable, cpu_status and
cpu_release functions.

arch/arm/mach-zynqmp/mp.c:166:16: warning: comparison of unsigned expression
in '>= 0' is always true [-Wtype-limits]
166 |         if (nr >= ZYNQMP_CORE_APU0 && nr <= ZYNQMP_CORE_APU3) {
    |                ^~

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20221004053454.25470-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
arch/arm/mach-zynqmp/mp.c

index 4f1ed44afb6b9d930095eef3f757a6860542398d..949456d530903abc3407810f89768b11e4af77e9 100644 (file)
@@ -163,7 +163,7 @@ static int check_r5_mode(void)
 
 int cpu_disable(u32 nr)
 {
-       if (nr >= ZYNQMP_CORE_APU0 && nr <= ZYNQMP_CORE_APU3) {
+       if (nr <= ZYNQMP_CORE_APU3) {
                u32 val = readl(&crfapb_base->rst_fpd_apu);
                val |= 1 << nr;
                writel(val, &crfapb_base->rst_fpd_apu);
@@ -176,7 +176,7 @@ int cpu_disable(u32 nr)
 
 int cpu_status(u32 nr)
 {
-       if (nr >= ZYNQMP_CORE_APU0 && nr <= ZYNQMP_CORE_APU3) {
+       if (nr <= ZYNQMP_CORE_APU3) {
                u32 addr_low = readl(((u8 *)&apu_base->rvbar_addr0_l) + nr * 8);
                u32 addr_high = readl(((u8 *)&apu_base->rvbar_addr0_h) +
                                      nr * 8);
@@ -252,7 +252,7 @@ void initialize_tcm(bool mode)
 
 int cpu_release(u32 nr, int argc, char *const argv[])
 {
-       if (nr >= ZYNQMP_CORE_APU0 && nr <= ZYNQMP_CORE_APU3) {
+       if (nr <= ZYNQMP_CORE_APU3) {
                u64 boot_addr = simple_strtoull(argv[0], NULL, 16);
                /* HIGH */
                writel((u32)(boot_addr >> 32),