[u-boot][PATCH 07/14] mtd: rawnand: nand_spl_loaders: Fix cast type build warning

Michael Nazzareno Trimarchi michael at amarulasolutions.com
Sun Nov 6 20:50:44 CET 2022


On Tue, Oct 11, 2022 at 1:50 PM Roger Quadros <rogerq at kernel.org> wrote:
>
> Fixes the below build warning on 64-bit platforms.
>
> drivers/mtd/nand/raw/nand_spl_loaders.c:26:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>       dst = (void *)((int)dst - page_offset);
>
> Signed-off-by: Roger Quadros <rogerq at kernel.org>
> ---
>  drivers/mtd/nand/raw/nand_spl_loaders.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/raw/nand_spl_loaders.c b/drivers/mtd/nand/raw/nand_spl_loaders.c
> index 4befc75c04..156b44d835 100644
> --- a/drivers/mtd/nand/raw/nand_spl_loaders.c
> +++ b/drivers/mtd/nand/raw/nand_spl_loaders.c
> @@ -23,7 +23,7 @@ int nand_spl_load_image(uint32_t offs, unsigned int size, void *dst)
>                                 if (unlikely(page_offset)) {
>                                         memmove(dst, dst + page_offset,
>                                                 CONFIG_SYS_NAND_PAGE_SIZE);
> -                                       dst = (void *)((int)dst - page_offset);
> +                                       dst = (void *)(dst - page_offset);
>                                         page_offset = 0;
>                                 }
>                                 dst += CONFIG_SYS_NAND_PAGE_SIZE;

Reviewed-by: Michael Trimarchi <michael at amarulasolutions.com>

> --
> 2.17.1
>


-- 
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
michael at amarulasolutions.com
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
info at amarulasolutions.com
www.amarulasolutions.com


More information about the U-Boot mailing list