Re: [PATCH v2] board: sifive: Fix a potential build warning in board_fdt_blob_setup()

From: Bin Meng bmeng.cn@gmail.com Sent: Saturday, September 11, 2021 10:31 PM To: Zong Li zong.li@sifive.com; Leo Yu-Chi Liang(梁育齊) ycliang@andestech.com; Rick Jian-Zhi Chen(陳建志) rick@andestech.com; u-boot@lists.denx.de Subject: [PATCH v2] 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-b...
Signed-off-by: Bin Meng bmeng.cn@gmail.com
Changes in v2:
- Correct the commit title
board/sifive/unleashed/unleashed.c | 4 ++-- board/sifive/unmatched/unmatched.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Rick Chen rick@andestech.com

On Fri, Sep 17, 2021 at 2:52 PM Rick Chen rickchen36@gmail.com wrote:
From: Bin Meng bmeng.cn@gmail.com Sent: Saturday, September 11, 2021 10:31 PM To: Zong Li zong.li@sifive.com; Leo Yu-Chi Liang(梁育齊) ycliang@andestech.com; Rick Jian-Zhi Chen(陳建志) rick@andestech.com; u-boot@lists.denx.de Subject: [PATCH v2] 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-b...
Signed-off-by: Bin Meng bmeng.cn@gmail.com
Changes in v2:
- Correct the commit title
board/sifive/unleashed/unleashed.c | 4 ++-- board/sifive/unmatched/unmatched.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Rick Chen rick@andestech.com
Ping for apply?
participants (2)
-
Bin Meng
-
Rick Chen