[openwrt/openwrt] realtek: fix gcc-12 build with -Werror=array-compare

LEDE Commits lede-commits at lists.infradead.org
Wed Jun 22 09:58:41 PDT 2022


svanheule pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/d6eebaf99570aa6de0b10694fcb11ee8c0195d3c

commit d6eebaf99570aa6de0b10694fcb11ee8c0195d3c
Author: Bjørn Mork <bjorn at mork.no>
AuthorDate: Sun Jun 19 15:59:27 2022 +0200

    realtek: fix gcc-12 build with -Werror=array-compare
    
    Removing this gcc-12 error:
    
    arch/mips/rtl838x/setup.c:64:30: error: comparison between two arrays [-Werror=array-compare]
       64 |         else if (__dtb_start != __dtb_end)
    
    Signed-off-by: Bjørn Mork <bjorn at mork.no>
---
 target/linux/realtek/files-5.10/arch/mips/rtl838x/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/realtek/files-5.10/arch/mips/rtl838x/setup.c b/target/linux/realtek/files-5.10/arch/mips/rtl838x/setup.c
index 55419c7b0b..18c477eb0f 100644
--- a/target/linux/realtek/files-5.10/arch/mips/rtl838x/setup.c
+++ b/target/linux/realtek/files-5.10/arch/mips/rtl838x/setup.c
@@ -61,7 +61,7 @@ void __init plat_mem_setup(void)
 
 	if (fw_passed_dtb) /* UHI interface */
 		dtb = (void *)fw_passed_dtb;
-	else if (__dtb_start != __dtb_end)
+	else if (&__dtb_start[0] != &__dtb_end[0])
 		dtb = (void *)__dtb_start;
 	else
 		panic("no dtb found");




More information about the lede-commits mailing list