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

Bjørn Mork bjorn at mork.no
Sun Jun 19 06:59:27 PDT 2022


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>
---
Kind of stupid....

But this is how similar fallout has been fixed in mainline AFAICS. For
example commit ca831f29f8f2 ("mm: page_alloc: fix building error on
-Werror=array-compare")

 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 55419c7b0b7a..18c477eb0fe7 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");
-- 
2.30.2




More information about the openwrt-devel mailing list