Re: [PATCH] fdtdump: fix -Werror=int-to-pointer-cast

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



On Wed, Aug 25, 2021 at 04:13:50PM +0400, marcandre.lureau@xxxxxxxxxx wrote:
> From: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
> 
> With mingw64-gcc, the compiler complains with various warnings:
> error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>

Applied, thanks.

> ---
>  fdtdump.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fdtdump.c b/fdtdump.c
> index bdc0f94..d424869 100644
> --- a/fdtdump.c
> +++ b/fdtdump.c
> @@ -21,7 +21,7 @@
>  #define MAX_VERSION 17U
>  
>  #define ALIGN(x, a)	(((x) + ((a) - 1)) & ~((a) - 1))
> -#define PALIGN(p, a)	((void *)(ALIGN((unsigned long)(p), (a))))
> +#define PALIGN(p, a)	((void *)(ALIGN((uintptr_t)(p), (a))))
>  #define GET_CELL(p)	(p += 4, *((const fdt32_t *)(p-4)))
>  
>  static const char *tagname(uint32_t tag)

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux