diff mbox series

mips: lantiq: Silence compiler complaints

Message ID 20221005080615.2656309-1-linus.walleij@linaro.org (mailing list archive)
State Rejected
Headers show
Series mips: lantiq: Silence compiler complaints | expand

Commit Message

Linus Walleij Oct. 5, 2022, 8:06 a.m. UTC
With recent GCC this warning appears:

CC  arch/mips/lantiq/prom.o
  arch/mips/lantiq/prom.c: In function 'plat_mem_setup':
  arch/mips/lantiq/prom.c:82:30:
  error: comparison between two arrays [-Werror=array-compare]
   82 |         else if (__dtb_start != __dtb_end)
      |                              ^~
  arch/mips/lantiq/prom.c:82:30: note:
  use '&__dtb_start[0] != &__dtb_end[0]' to compare the addresses

OK let's add & in front of the addresses so it's unambiguous.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/mips/lantiq/prom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Linus Walleij Oct. 5, 2022, 8:10 a.m. UTC | #1
On Wed, Oct 5, 2022 at 10:06 AM Linus Walleij <linus.walleij@linaro.org> wrote:

> With recent GCC this warning appears:

Nah scratch that, it turns out I was using an old v5.10 branch for my
test compiles by mistake.
Sorry.

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/arch/mips/lantiq/prom.c b/arch/mips/lantiq/prom.c
index 51a218f04fe0..3f568f5aae2d 100644
--- a/arch/mips/lantiq/prom.c
+++ b/arch/mips/lantiq/prom.c
@@ -79,7 +79,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 != &__dtb_end)
 		dtb = (void *)__dtb_start;
 	else
 		panic("no dtb found");