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

2022-06-22 Thread Sander Vanheule
On Sun, 2022-06-19 at 15:59 +0200, Bjørn Mork wrote:
> 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 
> ---
> 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")

Externally linked data can be weird like that. Thanks for spotting this early, 
I'll be merging the
patch.

Best,
Sander

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


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

2022-06-19 Thread Bjørn Mork
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 
---
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


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel