summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorimcu <[email protected]>2025-01-16 11:01:12 +0800
committerRbb666 <[email protected]>2025-01-20 14:26:50 +0800
commit680333fc18b41d24c3da9ae736af9471aa03ff04 (patch)
tree44fa2c3ba44c2d488b8940863ee812f35fbfcb3b
parent77e95594db92ba4beac83b39e7b0920f0edd39cf (diff)
[bsp][cvitek] fix c906_little build warning in cache.c
build warning: passing argument 1 of 'inv_icache_range' makes integer from pointer without a cast [-Wint-conversion] Analyze: The passed parameter type is void*, which is a pointer type, but the required type is uintptr_t, which is an integer type. Therefore, there will be a 'makes integer from pointer without a cast' warning. Solution: casting the void* pointer to uintptr_t, ensure that the function receives the correct type. Signed-off-by: zdtyuiop4444 <[email protected]>
-rw-r--r--bsp/cvitek/c906_little/board/cache.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/bsp/cvitek/c906_little/board/cache.c b/bsp/cvitek/c906_little/board/cache.c
index 8ca9636553..56ea9d4943 100644
--- a/bsp/cvitek/c906_little/board/cache.c
+++ b/bsp/cvitek/c906_little/board/cache.c
@@ -5,6 +5,7 @@
*
* Change Logs:
* Date Author Notes
+ * 2025/01/16 zdtyuiop4444 fix type cast warning
* 2024/11/26 zdtyuiop4444 The first version
*/
@@ -33,10 +34,10 @@ inline void rt_hw_cpu_dcache_ops(int ops, void* addr, int size)
switch (ops)
{
case RT_HW_CACHE_FLUSH:
- flush_dcache_range(addr, size);
+ flush_dcache_range((uintptr_t)addr, size);
break;
case RT_HW_CACHE_INVALIDATE:
- inv_dcache_range(addr, size);
+ inv_dcache_range((uintptr_t)addr, size);
break;
default:
break;
@@ -62,7 +63,7 @@ inline void rt_hw_cpu_icache_ops(int ops, void* addr, int size)
switch (ops)
{
case RT_HW_CACHE_INVALIDATE:
- inv_icache_range(addr, size);
+ inv_icache_range((uintptr_t)addr, size);
break;
default:
break;