From c7841ce4726c77deff2f1fc15e1478d4f45a49b9 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Mon, 19 May 2025 14:23:14 -0700 Subject: [PATCH] xtensa: gdbstub: fix compiler warning about discarding const Inside copy_to_ctx(), we are typecasting the stack pointer into a 32-bit array pointer, and there was unbalanced const between two sides. Since we should not be modifying anything inside that array, add const to the 32-bit array pointer too. So now the compiler will not complain about discarding the const qualifier. Signed-off-by: Daniel Leung --- arch/xtensa/core/gdbstub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/xtensa/core/gdbstub.c b/arch/xtensa/core/gdbstub.c index 91a1d58f801..766c626ce94 100644 --- a/arch/xtensa/core/gdbstub.c +++ b/arch/xtensa/core/gdbstub.c @@ -427,7 +427,7 @@ static void copy_to_ctx(struct gdb_ctx *ctx, const struct arch_esf *stack) struct xtensa_register *reg; int idx, num_laddr_regs; - uint32_t *bsa = *(const int **)stack; + const uint32_t *bsa = *(const int **)stack; if (bsa - (const uint32_t *)stack > 12) { num_laddr_regs = 16;