diff options
| author | Chen Wang <[email protected]> | 2025-01-27 10:58:05 +0800 |
|---|---|---|
| committer | Meco Man <[email protected]> | 2025-01-29 20:28:38 -0500 |
| commit | 2dfbae28532303526f6bf4b60a54794c845d444a (patch) | |
| tree | c93f0130a38af0c13843e6cf9cfbae4678d37bd0 /libcpu | |
| parent | 3383352cdc96238b9e967a8ded7189a563359ba6 (diff) | |
libcpu: riscv: common: fixed build warnings
When building bsp/cvitek/c906_little, compiler warns:
```
.../rt-thread/libcpu/risc-v/common/trap_common.c:
In function 'rt_hw_interrupt_install':
.../rt-thread/libcpu/risc-v/common/trap_common.c:50:11:
warning: unused variable 'user_param' [-Wunused-variable]
50 | void *user_param = param;
| ^~~~~~~~~~
.../rt-thread/libcpu/risc-v/common/trap_common.c:
In function 'rt_rv32_system_irq_handler':
.../rt-thread/libcpu/risc-v/common/trap_common.c:77:25:
warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
77 | s_stack_frame = (rt_hw_stack_frame_t *)mscratch;
| ^
```
Fixed these warnings as per indication from gcc.
Signed-off-by: Chen Wang <[email protected]>
Diffstat (limited to 'libcpu')
| -rw-r--r-- | libcpu/risc-v/common/trap_common.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libcpu/risc-v/common/trap_common.c b/libcpu/risc-v/common/trap_common.c index 6f7352cd56..0dbd7f2c75 100644 --- a/libcpu/risc-v/common/trap_common.c +++ b/libcpu/risc-v/common/trap_common.c @@ -47,7 +47,6 @@ rt_weak rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t ha void *param, const char *name) { rt_isr_handler_t old_handler = RT_NULL; - void *user_param = param; if(vector < ISR_NUMBER) { @@ -74,7 +73,7 @@ rt_weak void rt_rv32_system_irq_handler(rt_uint32_t mcause) rt_uint32_t exception = !(mcause & 0x80000000); if(exception) { - s_stack_frame = (rt_hw_stack_frame_t *)mscratch; + s_stack_frame = (volatile rt_hw_stack_frame_t *)(uintptr_t)mscratch; rt_show_stack_frame(); } else |
