Skip to content

Commit 618a478

Browse files
dcpleungnashif
authored andcommitted
xtensa: fix sparse warning when converting to uncache pointer
The argument to arch_xtensa_uncached_ptr() is marked as in the cached address space. However, when it is being passed to z_xtropflip(), it is simply casted to uint32_t, thus resulting in sparse warning about discarding "__cached" address space. This adds __sparse_force to the cast to suppress the warning. Signed-off-by: Daniel Leung <[email protected]>
1 parent cf34afd commit 618a478

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/zephyr/arch/xtensa/cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static inline void __sparse_cache *arch_xtensa_cached_ptr(void *ptr)
177177
*/
178178
static inline void *arch_xtensa_uncached_ptr(void __sparse_cache *ptr)
179179
{
180-
return (void *)z_xtrpoflip((uint32_t) ptr,
180+
return (void *)z_xtrpoflip((__sparse_force uint32_t)ptr,
181181
CONFIG_XTENSA_UNCACHED_REGION,
182182
CONFIG_XTENSA_CACHED_REGION);
183183
}

0 commit comments

Comments
 (0)