Skip to content

Commit

Permalink
module_adapter: Correct C99ism
Browse files Browse the repository at this point in the history
Compiler flags used with older xcc compilers still disallow
declarations in for() expressions.

Signed-off-by: Andy Ross <andyross@google.com>
  • Loading branch information
andyross committed Jun 7, 2024
1 parent da03f82 commit 9f985fc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/include/sof/audio/module_adapter/module/generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ bool module_is_ready_to_process(struct processing_module *mod,
struct sof_sink **sinks,
int num_of_sinks)
{
int i;
const struct module_interface *const ops = mod->dev->drv->adapter_ops;

/* LL module has to be always ready for processing */
Expand All @@ -180,11 +181,11 @@ bool module_is_ready_to_process(struct processing_module *mod,
/* default action - the module is ready if there's enough data for processing and enough
* space to store result. IBS/OBS as declared in init_instance
*/
for (int i = 0; i < num_of_sources; i++)
for (i = 0; i < num_of_sources; i++)
if (source_get_data_available(sources[i]) < source_get_min_available(sources[i]))
return false;

for (int i = 0; i < num_of_sinks; i++)
for (i = 0; i < num_of_sinks; i++)
if (sink_get_free_size(sinks[i]) < sink_get_min_free_space(sinks[i]))
return false;

Expand Down

0 comments on commit 9f985fc

Please sign in to comment.