Skip to content

Commit 1bfe896

Browse files
Jaska Uimonendbaluta
authored andcommitted
module_adapter: do proper sparse_force casting
Buffers allocated need to be sparse_force casted when assigning to sparse_cache typed variables. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
1 parent 03360c6 commit 1bfe896

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/audio/module_adapter/module_adapter.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,8 @@ int module_adapter_prepare(struct comp_dev *dev)
276276
list_for_item(blist, &dev->bsource_list) {
277277
size_t size = MAX(mod->deep_buff_bytes, mod->period_bytes);
278278

279-
mod->input_buffers[i].data = rballoc(0, SOF_MEM_CAPS_RAM, size);
279+
mod->input_buffers[i].data =
280+
(__sparse_force void __sparse_cache *)rballoc(0, SOF_MEM_CAPS_RAM, size);
280281
if (!mod->input_buffers[i].data) {
281282
comp_err(mod->dev, "module_adapter_prepare(): Failed to alloc input buffer data");
282283
ret = -ENOMEM;
@@ -288,7 +289,9 @@ int module_adapter_prepare(struct comp_dev *dev)
288289
/* allocate memory for output buffer data */
289290
i = 0;
290291
list_for_item(blist, &dev->bsink_list) {
291-
mod->output_buffers[i].data = rballoc(0, SOF_MEM_CAPS_RAM, md->mpd.out_buff_size);
292+
mod->output_buffers[i].data =
293+
(__sparse_force void __sparse_cache *)rballoc(0, SOF_MEM_CAPS_RAM,
294+
md->mpd.out_buff_size);
292295
if (!mod->output_buffers[i].data) {
293296
comp_err(mod->dev, "module_adapter_prepare(): Failed to alloc output buffer data");
294297
ret = -ENOMEM;

0 commit comments

Comments
 (0)