Skip to content

Commit

Permalink
ipc4: handler: Fix compilation with gcc in ipc4_set_pipeline_state()
Browse files Browse the repository at this point in the history
gcc fails with the following warning (treated as error):
sof/src/ipc/ipc4/handler.c: In function 'ipc_cmd':
sof/src/ipc/ipc4/handler.c:471:5: error: 'status' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  471 |  if (status == COMP_STATE_READY)
      |     ^
sof/src/ipc/ipc4/handler.c:439:11: note: 'status' was declared here
  439 |  uint32_t status;
      |           ^~~~~~
cc1: all warnings being treated as errors
make[2]: *** [CMakeFiles/sof.dir/build.make:380: CMakeFiles/sof.dir/src/ipc/ipc4/handler.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2042: CMakeFiles/sof.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Based on the code, this is a false warning since ppl_count should never be
0 (unless ppl_data->pipelines_count is 0), but never the less, the firmware
does not compile with gcc.

Fixes: 72394a6 ("ipc4: update component direction when pipeline is complete")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
  • Loading branch information
ujfalusi authored and lgirdwood committed Mar 31, 2022
1 parent a5fd52e commit e043503
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ipc/ipc4/handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,9 @@ static int ipc4_set_pipeline_state(union ipc4_message_header *ipc4)
{
struct ipc4_pipeline_set_state_data *ppl_data;
struct ipc4_pipeline_set_state state;
uint32_t status = COMP_STATE_INIT;
uint32_t cmd, ppl_count;
uint32_t *ppl_id, id;
uint32_t status;
int ret = 0;
int i;

Expand Down

0 comments on commit e043503

Please sign in to comment.