Skip to content

Commit 680333f

Browse files
zdtyuiop4444Rbb666
authored andcommitted
[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]>
1 parent 77e9559 commit 680333f

File tree

1 file changed

+4
-3
lines changed
  • bsp/cvitek/c906_little/board

1 file changed

+4
-3
lines changed

bsp/cvitek/c906_little/board/cache.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*
66
* Change Logs:
77
* Date Author Notes
8+
* 2025/01/16 zdtyuiop4444 fix type cast warning
89
* 2024/11/26 zdtyuiop4444 The first version
910
*/
1011

@@ -33,10 +34,10 @@ inline void rt_hw_cpu_dcache_ops(int ops, void* addr, int size)
3334
switch (ops)
3435
{
3536
case RT_HW_CACHE_FLUSH:
36-
flush_dcache_range(addr, size);
37+
flush_dcache_range((uintptr_t)addr, size);
3738
break;
3839
case RT_HW_CACHE_INVALIDATE:
39-
inv_dcache_range(addr, size);
40+
inv_dcache_range((uintptr_t)addr, size);
4041
break;
4142
default:
4243
break;
@@ -62,7 +63,7 @@ inline void rt_hw_cpu_icache_ops(int ops, void* addr, int size)
6263
switch (ops)
6364
{
6465
case RT_HW_CACHE_INVALIDATE:
65-
inv_icache_range(addr, size);
66+
inv_icache_range((uintptr_t)addr, size);
6667
break;
6768
default:
6869
break;

0 commit comments

Comments
 (0)