Skip to content

Commit

Permalink
modules: Remove unused buffers
Browse files Browse the repository at this point in the history
The code allocating/freeing in_buff and out_buff buffers, which were not
used, was removed from the processing module adapter.

Signed-off-by: Adrian Warecki <[email protected]>
  • Loading branch information
softwarecki committed Mar 21, 2024
1 parent b288340 commit b093833
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/audio/module_adapter/module/modules.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,7 @@ static int modules_init(struct processing_module *mod)

md->module_entry_point = module_entry_point;

/* Allocate module buffers */
md->mpd.in_buff = rballoc(0, SOF_MEM_CAPS_RAM, src_cfg->ibs);
if (!md->mpd.in_buff) {
comp_err(dev, "modules_init(): Failed to alloc in_buff");
return -ENOMEM;
}
md->mpd.in_buff_size = src_cfg->ibs;

md->mpd.out_buff = rballoc(0, SOF_MEM_CAPS_RAM, src_cfg->obs);
if (!md->mpd.out_buff) {
comp_err(dev, "modules_init(): Failed to alloc out_buff");
rfree(md->mpd.in_buff);
return -ENOMEM;
}
md->mpd.out_buff_size = src_cfg->obs;

mod->proc_type = MODULE_PROCESS_TYPE_SOURCE_SINK;
Expand Down Expand Up @@ -147,17 +134,13 @@ static int modules_process(struct processing_module *mod,
static int modules_free(struct processing_module *mod)
{
struct comp_dev *dev = mod->dev;
struct module_data *md = &mod->priv;
int ret;

comp_info(dev, "modules_free()");
ret = iadk_wrapper_free(mod->priv.module_adapter);
if (ret)
comp_err(dev, "modules_free(): iadk_wrapper_free failed with error: %d", ret);

rfree(md->mpd.in_buff);
rfree(md->mpd.out_buff);

/* Free module resources allocated in L2 memory. */
ret = lib_manager_free_module(dev->ipc_config.id);
if (ret < 0)
Expand Down

0 comments on commit b093833

Please sign in to comment.