Skip to content

Commit bd655a7

Browse files
committed
userspace: (cosmetic) clean up sparse use
Fix wrong sparse type-casting. Signed-off-by: Guennadi Liakhovetski <[email protected]>
1 parent 5eafd46 commit bd655a7

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

zephyr/lib/userspace_helper.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,14 @@ void module_driver_heap_remove(struct k_heap *mod_drv_heap)
6060

6161
void *user_stack_allocate(size_t stack_size, uint32_t options)
6262
{
63-
return (__sparse_force void __sparse_cache *)
64-
k_thread_stack_alloc(stack_size, options & K_USER);
63+
return k_thread_stack_alloc(stack_size, options & K_USER);
6564
}
6665

6766
int user_stack_free(void *p_stack)
6867
{
6968
if (!p_stack)
7069
return 0;
71-
return k_thread_stack_free((__sparse_force void *)p_stack);
70+
return k_thread_stack_free(p_stack);
7271
}
7372

7473
int user_memory_init_shared(k_tid_t thread_id, struct processing_module *mod)
@@ -89,15 +88,14 @@ void *user_stack_allocate(size_t stack_size, uint32_t options)
8988
{
9089
/* allocate stack - must be aligned and cached so a separate alloc */
9190
stack_size = K_KERNEL_STACK_LEN(stack_size);
92-
void *p_stack = (__sparse_force void __sparse_cache *)
93-
rballoc_align(SOF_MEM_FLAG_USER, stack_size, Z_KERNEL_STACK_OBJ_ALIGN);
91+
void *p_stack = rballoc_align(SOF_MEM_FLAG_USER, stack_size, Z_KERNEL_STACK_OBJ_ALIGN);
9492

9593
return p_stack;
9694
}
9795

9896
int user_stack_free(void *p_stack)
9997
{
100-
rfree((__sparse_force void *)p_stack);
98+
rfree(p_stack);
10199
return 0;
102100
}
103101

0 commit comments

Comments
 (0)