riscv: ae350: Use #if defined instead of CONFIG_IS_ENABLED
PATCH 1/1 riscv: ae350: Use #if defined instead of CONFIG_IS_ENABLED
According to ./include/linux/kconfig.h,CONFIG_IS_ENABLED(OF_BOARD) expands to 0
when CONFIG_SPL_BUILD is defined because
there is no CONFIG_SPL_OF_BOARD.
Use #if defined instead.
--- board/AndesTech/ax25-ae350/ax25-ae350.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
board/AndesTech/ax25-ae350/ax25-ae350.c +2 -2
@@ -56,9 +56,9 @@ ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info)void *board_fdt_blob_setup (void ) { -#if CONFIG_IS_ENABLED (OF_BOARD ) +#if defined(CONFIG_OF_BOARD )return (void *)(ulong )gd->arch.firmware_fdt_addr; -#elif CONFIG_IS_ENABLED (OF_SEPARATE ) +#elif defined(CONFIG_OF_SEPARATE )return (void *)CONFIG_SYS_FDT_BASE ;#else return NULL ;
Signature · 1 line
2.17.0
A message that is not in the archive (sent off-list or not yet received): HK0PR03MB2994A2BC40279DC7AF913DE2C18A9@HK0PR03MB2994.apcprd03.prod.outlook.com
Rick Chen
Reviewed-byQuoted 9 lines
From: Leo Yu-Chi Liang(梁育齊) <[email protected]>
Sent: Wednesday, October 27, 2021 4:59 PM
To: Rick Jian-Zhi Chen(陳建志) <[email protected]>; Leo Yu-Chi Liang(梁育齊) <[email protected]>
Cc: [email protected]
Subject: [PATCH] riscv: ae350: Use #if defined instead ofCONFIG_IS_ENABLEDAccording to
./include/linux/kconfig.h,CONFIG_IS_ENABLED(OF_BOARD)expands to 0 whenCONFIG_SPL_BUILDis defined because there is noCONFIG_SPL_OF_BOARD.
Quoted 6 lines
Use #if defined instead.
Signed-off-by Leo Yu-Chi Liang <[email protected]>--- board/AndesTech/ax25-ae350/ax25-ae350.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Hi Leo,
Quoted 5 lines · Leo Yu-Chi Liang
According to
./include/linux/kconfig.h,CONFIG_IS_ENABLED(OF_BOARD)expands to 0
whenCONFIG_SPL_BUILDis defined because
there is noCONFIG_SPL_OF_BOARD.
Why is the change?
Quoted 8 lines
Use #if defined instead.
Signed-off-by Leo Yu-Chi Liang <[email protected]>--- board/AndesTech/ax25-ae350/ax25-ae350.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Regards,
Bin
Hi Bin,
Quoted 11 lines · Bin Meng
Hi Leo,
Quoted 5 lines · Leo Yu-Chi Liang
According to
./include/linux/kconfig.h,CONFIG_IS_ENABLED(OF_BOARD)expands to 0
whenCONFIG_SPL_BUILDis defined because
there is noCONFIG_SPL_OF_BOARD.Why is the change?
The original code was
void *board_fdt_blob_setup(void)
{
#if CONFIG_IS_ENABLED(OF_BOARD)
return (void *)(ulong)gd->arch.firmware_fdt_addr;
#elif CONFIG_IS_ENABLED(OF_SEPARATE)
return (void *)CONFIG_SYS_FDT_BASE;
#else
return NULL;
}
But the "return (void *)(ulong)gd->arch.firmware_fdt_addr;" does not get compiled even if OF_BOARD is selected when building ae350_*_spl_*_defconfig, thus this patch.
The reason is because ./include/linux/kconfig.h states "CONFIG_IS_ENABLED(FOO) expands to 1 if CONFIG_SPL_BUILD is defined and CONFIG_SPL_FOO is set to 'y'".
However, we don't have CONFIG_SPL_OF_BOARD, so CONFIG_IS_ENABLED(OF_BOARD) only expands to 0.
Best regards,
Leo
Quoted 11 lines
Quoted 8 lines
Use #if defined instead.
Signed-off-by Leo Yu-Chi Liang <[email protected]>--- board/AndesTech/ax25-ae350/ax25-ae350.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Regards,
Bin
Bin Meng
Reviewed-byHi Leo,
Quoted 31 lines · Leo Liang
Hi Bin,
Quoted 11 lines · Bin Meng
Hi Leo,
Quoted 5 lines · Leo Yu-Chi Liang
According to
./include/linux/kconfig.h,CONFIG_IS_ENABLED(OF_BOARD)expands to 0
whenCONFIG_SPL_BUILDis defined because
there is noCONFIG_SPL_OF_BOARD.Why is the change?
The original code was
void
*board_fdt_blob_setup(void)
{#if CONFIG_IS_ENABLED(OF_BOARD) return (void *)(ulong)gd->arch.firmware_fdt_addr; #elif CONFIG_IS_ENABLED(OF_SEPARATE) return (void *)CONFIG_SYS_FDT_BASE; #else return NULL; }But the "return (void *)(ulong)gd->arch.firmware_fdt_addr;" does not get compiled even if
OF_BOARDis selected when building ae350_*_spl_*_defconfig, thus this patch.
Quoted 6 lines
The reason is because
./include/linux/kconfig.hstates "CONFIG_IS_ENABLED(FOO)expands to 1 ifCONFIG_SPL_BUILDis defined andCONFIG_SPL_FOOis set to 'y'".
However, we don't haveCONFIG_SPL_OF_BOARD, soCONFIG_IS_ENABLED(OF_BOARD)only expands to 0.
Thanks!
Please add:
Regards,
Bin
Quoted 41 lines · Bin Meng
Hi Leo,
Quoted 31 lines · Leo Liang
Hi Bin,
Quoted 11 lines · Bin Meng
Hi Leo,
Quoted 5 lines · Leo Yu-Chi Liang
According to
./include/linux/kconfig.h,CONFIG_IS_ENABLED(OF_BOARD)expands to 0
whenCONFIG_SPL_BUILDis defined because
there is noCONFIG_SPL_OF_BOARD.Why is the change?
The original code was
void
*board_fdt_blob_setup(void)
{#if CONFIG_IS_ENABLED(OF_BOARD) return (void *)(ulong)gd->arch.firmware_fdt_addr; #elif CONFIG_IS_ENABLED(OF_SEPARATE) return (void *)CONFIG_SYS_FDT_BASE; #else return NULL; }But the "return (void *)(ulong)gd->arch.firmware_fdt_addr;" does not get compiled even if
OF_BOARDis selected when building ae350_*_spl_*_defconfig, thus this patch.Quoted 6 lines
The reason is because
./include/linux/kconfig.hstates "CONFIG_IS_ENABLED(FOO)expands to 1 ifCONFIG_SPL_BUILDis defined andCONFIG_SPL_FOOis set to 'y'".
However, we don't haveCONFIG_SPL_OF_BOARD, soCONFIG_IS_ENABLED(OF_BOARD)only expands to 0.
Quoted 7 lines
Thanks!
Please add:
Fixes 2e8d2f88439d ("riscv: Remove OF_PRIOR_STAGE from RISC-V boards")Reviewed-by Bin Meng <[email protected]>
Will do. Thanks!
Best regards,
Leo
Quoted 2 lines
Regards,
Bin