diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2021-09-11 22:31:23 +0800 |
---|---|---|
committer | Leo Yu-Chi Liang <ycliang@andestech.com> | 2021-10-20 10:59:00 +0800 |
commit | a0cfe137157243d9cfcc928e0939b3d65274b554 (patch) | |
tree | f40823ec08d5554c287550f126880bede4ba7276 /board | |
parent | fb1018106a7bbb1a0d723029f6760b1b1b4d306d (diff) | |
download | u-boot-a0cfe137157243d9cfcc928e0939b3d65274b554.zip u-boot-a0cfe137157243d9cfcc928e0939b3d65274b554.tar.gz u-boot-a0cfe137157243d9cfcc928e0939b3d65274b554.tar.bz2 |
board: sifive: Fix a potential build warning in board_fdt_blob_setup()
Commit 47d73ba4f4a4 ("board: sifive: overwrite board_fdt_blob_setup in u-boot proper")
added a board-specific implementation of board_fdt_blob_setup() which
takes a pointer as the return value, but it does not return anything
if CONFIG_OF_SEPARATE is not enabled. This will cause a build warning
seen when testing booting S-mode U-Boot directly from QEMU, per the
instructions in [1]:
board/sifive/unleashed/unleashed.c: In function ‘board_fdt_blob_setup’:
board/sifive/unleashed/unleashed.c:125:1: warning: control reaches end of non-void function [-Wreturn-type]
Return &_end as the default case.
[1] https://qemu.readthedocs.io/en/latest/system/riscv/sifive_u.html#running-u-boot
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Reviewed-by: Rick Chen <rick@andestech.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/sifive/unleashed/unleashed.c | 4 | ||||
-rw-r--r-- | board/sifive/unmatched/unmatched.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/board/sifive/unleashed/unleashed.c b/board/sifive/unleashed/unleashed.c index 8cd514d..33baeda 100644 --- a/board/sifive/unleashed/unleashed.c +++ b/board/sifive/unleashed/unleashed.c @@ -119,9 +119,9 @@ void *board_fdt_blob_setup(void) if (IS_ENABLED(CONFIG_OF_SEPARATE)) { if (gd->arch.firmware_fdt_addr) return (ulong *)gd->arch.firmware_fdt_addr; - else - return (ulong *)&_end; } + + return (ulong *)&_end; } int board_init(void) diff --git a/board/sifive/unmatched/unmatched.c b/board/sifive/unmatched/unmatched.c index d90b252..8773b66 100644 --- a/board/sifive/unmatched/unmatched.c +++ b/board/sifive/unmatched/unmatched.c @@ -16,9 +16,9 @@ void *board_fdt_blob_setup(void) if (IS_ENABLED(CONFIG_OF_SEPARATE)) { if (gd->arch.firmware_fdt_addr) return (ulong *)gd->arch.firmware_fdt_addr; - else - return (ulong *)&_end; } + + return (ulong *)&_end; } int board_init(void) |