Skip to contentSkip to conversation

board: sifive: overwrite board_fdt_blob_setup in u-boot proper

PATCH In review Bin Meng 1 participant 2 messages Sep 11, 2021 SiFive drivers

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH 1/1 board: sifive: overwrite board_fdt_blob_setup in u-boot proper

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

---

 board/sifive/unleashed/unleashed.c | 4 ++--
 board/sifive/unmatched/unmatched.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
board/sifive/unleashed/unleashed.c +2 -2
index 8cd514df30..33baeda986 100644
@@ -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)
board/sifive/unmatched/unmatched.c +2 -2
index d90b252bae..8773b660fa 100644
@@ -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)
Signature · 1 line
2.25.1
author
#1 lore raw
Quoted 13 lines · Bin Meng

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.

Quoted 9 lines

[1] https://qemu.readthedocs.io/en/latest/system/riscv/sifive_u.html#running-u-boot

---

 board/sifive/unleashed/unleashed.c | 4 ++--
 board/sifive/unmatched/unmatched.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Oops, wrong commit title, please ignore.

Regards,
Bin