From 1f6d6deaef44acfa2cb853533b12ba300b30ce12 Mon Sep 17 00:00:00 2001 From: Jaska Uimonen Date: Wed, 2 Nov 2022 13:21:19 +0200 Subject: [PATCH] sparse: fix sparse warnings found in sof compilation Add proper sparse_force cast to assigments into sparse_cache pointers. Signed-off-by: Jaska Uimonen --- drivers/console/winstream_console.c | 3 ++- soc/xtensa/intel_adsp/cavs/multiprocessing.c | 2 +- soc/xtensa/intel_adsp/common/boot_complete.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/console/winstream_console.c b/drivers/console/winstream_console.c index c711f595ec3..0027e5ef16e 100644 --- a/drivers/console/winstream_console.c +++ b/drivers/console/winstream_console.c @@ -55,7 +55,8 @@ static int winstream_console_init(const struct device *d) return -ENODEV; } const struct mem_win_config *config = dev->config; - void *buf = arch_xtensa_uncached_ptr((void *)config->mem_base); + void *buf = + arch_xtensa_uncached_ptr((__sparse_force void __sparse_cache *)config->mem_base); winstream = sys_winstream_init(buf, config->size); diff --git a/soc/xtensa/intel_adsp/cavs/multiprocessing.c b/soc/xtensa/intel_adsp/cavs/multiprocessing.c index 9501ccc62e3..3504e9156be 100644 --- a/soc/xtensa/intel_adsp/cavs/multiprocessing.c +++ b/soc/xtensa/intel_adsp/cavs/multiprocessing.c @@ -73,7 +73,7 @@ void soc_start_core(int cpu_num) * such that the standard system bootstrap out of IMR can * place it there. But this is fine for now. */ - void **lpsram = z_soc_uncached_ptr((void *)LP_SRAM_BASE); + void **lpsram = z_soc_uncached_ptr((__sparse_force void __sparse_cache *)LP_SRAM_BASE); uint8_t tramp[] = { 0x06, 0x01, 0x00, /* J (jump to L32R) */ 0, /* (padding to align entry_addr) */ diff --git a/soc/xtensa/intel_adsp/common/boot_complete.c b/soc/xtensa/intel_adsp/common/boot_complete.c index 9e5cb043baa..aca44c61113 100644 --- a/soc/xtensa/intel_adsp/common/boot_complete.c +++ b/soc/xtensa/intel_adsp/common/boot_complete.c @@ -22,7 +22,7 @@ int boot_complete(const struct device *d) } config = dev->config; - win = z_soc_uncached_ptr((void *)config->mem_base); + win = z_soc_uncached_ptr((__sparse_force void __sparse_cache *)config->mem_base); /* Software protocol: "firmware entered" has the value 5 */ win[0] = 5;