Skip to content

Commit 1f6d6de

Browse files
Jaska Uimonennashif
Jaska Uimonen
authored andcommitted
sparse: fix sparse warnings found in sof compilation
Add proper sparse_force cast to assigments into sparse_cache pointers. Signed-off-by: Jaska Uimonen <[email protected]>
1 parent af5fb91 commit 1f6d6de

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

drivers/console/winstream_console.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ static int winstream_console_init(const struct device *d)
5555
return -ENODEV;
5656
}
5757
const struct mem_win_config *config = dev->config;
58-
void *buf = arch_xtensa_uncached_ptr((void *)config->mem_base);
58+
void *buf =
59+
arch_xtensa_uncached_ptr((__sparse_force void __sparse_cache *)config->mem_base);
5960

6061
winstream = sys_winstream_init(buf, config->size);
6162

soc/xtensa/intel_adsp/cavs/multiprocessing.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void soc_start_core(int cpu_num)
7373
* such that the standard system bootstrap out of IMR can
7474
* place it there. But this is fine for now.
7575
*/
76-
void **lpsram = z_soc_uncached_ptr((void *)LP_SRAM_BASE);
76+
void **lpsram = z_soc_uncached_ptr((__sparse_force void __sparse_cache *)LP_SRAM_BASE);
7777
uint8_t tramp[] = {
7878
0x06, 0x01, 0x00, /* J <PC+8> (jump to L32R) */
7979
0, /* (padding to align entry_addr) */

soc/xtensa/intel_adsp/common/boot_complete.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ int boot_complete(const struct device *d)
2222
}
2323
config = dev->config;
2424

25-
win = z_soc_uncached_ptr((void *)config->mem_base);
25+
win = z_soc_uncached_ptr((__sparse_force void __sparse_cache *)config->mem_base);
2626
/* Software protocol: "firmware entered" has the value 5 */
2727
win[0] = 5;
2828

0 commit comments

Comments
 (0)