[PATCH] arm64: zynqmp: Fix compiler warnings in mp.c

Michal Simek monstr at monstr.eu
Fri Oct 7 11:31:05 CEST 2022



On 10/4/22 07:34, Venkatesh Yadav Abbarapu wrote:
> 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 at amd.com>
> ---
> 
>   arch/arm/mach-zynqmp/mp.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/mach-zynqmp/mp.c b/arch/arm/mach-zynqmp/mp.c
> index 4f1ed44afb..949456d530 100644
> --- a/arch/arm/mach-zynqmp/mp.c
> +++ b/arch/arm/mach-zynqmp/mp.c
> @@ -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),


Applied.
M
-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs



More information about the U-Boot mailing list