cmd/nfsdown: fix recently introduced type mismatch issues 70/228470/1
authorMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 23 Mar 2020 08:05:39 +0000 (09:05 +0100)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 23 Mar 2020 08:05:53 +0000 (09:05 +0100)
commite9b88faeff90730ed12cd3ce371202694e4ed963
treecfe0b2b6623fe53e1e0f382c66acb49b125b8fd2
parent1cb7b19627cd9f6ec6d75fa47f9666f076c518c1
cmd/nfsdown: fix recently introduced type mismatch issues

When u-boot is configured from odroid-xu3_defconfig, the compiler reports following warnings:
In file included from include/config.h:5:0,
                 from include/common.h:23,
                 from cmd/nfsdown.c:11:
cmd/nfsdown.c: In function ‘do_nfs_down’:
include/configs/odroid_xu3.h:16:32: warning: passing argument 1 of ‘do_nfs_to_fat’ makes pointer from integer without a cast [-Wint-conversion]
 #define CONFIG_SYS_SDRAM_BASE  0x40000000
                                ^
cmd/nfsdown.c:24:27: note: in expansion of macro ‘CONFIG_SYS_SDRAM_BASE’
 #define NFS_DOWNLOAD_ADDR CONFIG_SYS_SDRAM_BASE
                           ^~~~~~~~~~~~~~~~~~~~~
cmd/nfsdown.c:429:25: note: in expansion of macro ‘NFS_DOWNLOAD_ADDR’
    size = do_nfs_to_fat(NFS_DOWNLOAD_ADDR, src_path,
                         ^~~~~~~~~~~~~~~~~
cmd/nfsdown.c:328:12: note: expected ‘void *’ but argument is of type ‘int’
 static int do_nfs_to_fat(void *addr, char *file_path, char *file_name,
            ^~~~~~~~~~~~~
In file included from include/config.h:5:0,
                 from include/common.h:23,
                 from cmd/nfsdown.c:11:
include/configs/odroid_xu3.h:16:32: warning: passing argument 2 of ‘do_nfs_to_mmc’ makes pointer from integer without a cast [-Wint-conversion]
 #define CONFIG_SYS_SDRAM_BASE  0x40000000
                                ^
cmd/nfsdown.c:24:27: note: in expansion of macro ‘CONFIG_SYS_SDRAM_BASE’
 #define NFS_DOWNLOAD_ADDR CONFIG_SYS_SDRAM_BASE
                           ^~~~~~~~~~~~~~~~~~~~~
cmd/nfsdown.c:433:30: note: in expansion of macro ‘NFS_DOWNLOAD_ADDR’
    size = do_nfs_to_mmc(mmc, NFS_DOWNLOAD_ADDR, src_path,
                              ^~~~~~~~~~~~~~~~~
cmd/nfsdown.c:282:12: note: expected ‘void *’ but argument is of type ‘int’
 static int do_nfs_to_mmc(struct mmc *mmc, void *addr, char *file_path,
            ^~~~~~~~~~~~~

Fix this by changing addr to unsigned long and adding needed casts.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ia78da10d04a0daf3301ddc6fa4c7b73000d33c22
cmd/nfsdown.c