arch/risc-v: rename local variable name to avoid shadowed declaration
In file included from common/addrenv.h:33, from common/riscv_initialstate.c:36: common/riscv_initialstate.c: In function 'up_initial_state': common/riscv_internal.h:136:16: warning: declaration of 'regval' shadows a previous local [-Wshadow] 136 | uintptr_t regval; \ | ^~~~~~ common/riscv_initialstate.c:74:12: note: in expansion of macro 'READ_CSR' 74 | regval = READ_CSR(CSR_VLENB); | ^~~~~~~~ common/riscv_initialstate.c:63:13: note: shadowed declaration is here 63 | uintptr_t regval; | ^~~~~~ Signed-off-by: chao an <anchao@lixiang.com>
This commit is contained in:
parent
41803a0c20
commit
4b086f595e
@ -133,16 +133,16 @@
|
|||||||
|
|
||||||
#define READ_CSR(reg) \
|
#define READ_CSR(reg) \
|
||||||
({ \
|
({ \
|
||||||
uintptr_t regval; \
|
uintptr_t __regval; \
|
||||||
__asm__ __volatile__("csrr %0, " __STR(reg) : "=r"(regval)); \
|
__asm__ __volatile__("csrr %0, " __STR(reg) : "=r"(__regval)); \
|
||||||
regval; \
|
__regval; \
|
||||||
})
|
})
|
||||||
|
|
||||||
#define READ_AND_SET_CSR(reg, bits) \
|
#define READ_AND_SET_CSR(reg, bits) \
|
||||||
({ \
|
({ \
|
||||||
uintptr_t regval; \
|
uintptr_t __regval; \
|
||||||
__asm__ __volatile__("csrrs %0, " __STR(reg) ", %1": "=r"(regval) : "rK"(bits)); \
|
__asm__ __volatile__("csrrs %0, " __STR(reg) ", %1": "=r"(__regval) : "rK"(bits)); \
|
||||||
regval; \
|
__regval; \
|
||||||
})
|
})
|
||||||
|
|
||||||
#define WRITE_CSR(reg, val) \
|
#define WRITE_CSR(reg, val) \
|
||||||
|
Loading…
Reference in New Issue
Block a user