Browse Source

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 <daniel.leung@intel.com>
pull/91613/head
Daniel Leung 2 months ago committed by Daniel DeGrasse
parent
commit
c7841ce472
  1. 2
      arch/xtensa/core/gdbstub.c

2
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; struct xtensa_register *reg;
int idx, num_laddr_regs; 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) { if (bsa - (const uint32_t *)stack > 12) {
num_laddr_regs = 16; num_laddr_regs = 16;

Loading…
Cancel
Save