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

Re: [Minios-devel] [PATCH 14/40] arm64: mm.c: fix the compiler error



Huang Shijie, on ven. 03 nov. 2017 03:11:51 +0000, wrote:
> The @_end is (unsigned int) type, and we will meet a compilor error:
> 
>  ---------------------------------------
>   mm.c: In function ‘arch_init_mm’:
>   mm.c:59:24: error: cast from pointer to integer of different size 
> [-Werror=pointer-to-int-cast]
>        unsigned int end = (unsigned int) &_end;
>  ---------------------------------------
> 
> This patch converts the type to uintptr_t, and fix the error.
> 
> Change-Id: If9604be7e6eccffcddb08bd280218cde52a25d86
> Jira: ENTOS-247
> Signed-off-by: Huang Shijie <shijie.huang@xxxxxxx>

Reviewed-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>

> ---
>  arch/arm/mm.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mm.c b/arch/arm/mm.c
> index f600672..3767357 100644
> --- a/arch/arm/mm.c
> +++ b/arch/arm/mm.c
> @@ -29,6 +29,7 @@ void arch_init_mm(unsigned long *start_pfn_p, unsigned long 
> *max_pfn_p)
>      int memory;
>      int prop_len = 0;
>      const uint64_t *regs;
> +    uintptr_t end;
>  
>      printk("    _text: %p(VA)\n", &_text);
>      printk("    _etext: %p(VA)\n", &_etext);
> @@ -57,7 +58,7 @@ void arch_init_mm(unsigned long *start_pfn_p, unsigned long 
> *max_pfn_p)
>          BUG();
>      }
>  
> -    unsigned int end = (unsigned int) &_end;
> +    end = (uintptr_t) &_end;
>      paddr_t mem_base = fdt64_to_cpu(regs[0]);
>      uint64_t mem_size = fdt64_to_cpu(regs[1]);
>      printk("Found memory at 0x%llx (len 0x%llx)\n",
> -- 
> 2.7.4
> 
> 
> _______________________________________________
> Minios-devel mailing list
> Minios-devel@xxxxxxxxxxxxxxxxxxxx
> https://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

-- 
Samuel
<s> T'as pas de portable ?
<m> J'ai un nokia, dans le bassin d'arcachon

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

 


Rackspace

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