Uh oh!
There was an error while loading. Please reload this page.
audio: dai-zephyr: Fix unused variable warning - #8723
Conversation
There was a problem hiding this comment.
Why not just use a better C99 declaration and move it right after the already existing #if CONFIG_IPC_MAJOR_4? We're in 2024 now...
C89 declarations are ugly and the #ifdef makes it even uglier.
In case you're wondering: we have C99 declarations in plenty other places and they never caused any issue with any toolchain. This topic was discussed in
| } else { | ||
| #if CONFIG_IPC_MAJOR_4 | ||
| struct list_item *sink_list; | ||
| #endif |
There was a problem hiding this comment.
echo Marc, please move line 259 after line 270, this will make code looks more integrity.
kv2019i
commented
Jan 12, 2024
@dbaluta can you check, fix is good, but moving the declaration down avoids adding an ifdef... |
Move sink_list under CONFIG_IPC_MAJOR_4 in order to avoid the following variable unused warning: $ sof/src/audio/dai-zephyr.c: In function 'dai_dma_cb': $ sof_dir/sof/src/audio/dai-zephyr.c:259:35: warning: unused variable 'sink_list' [-Wunused-variable] 259 | struct list_item *sink_list; | ^~~~~~~~~ Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
dbaluta
commented
Jan 15, 2024
done. |
Guard sink_list in order to avoid the following variable unused warning:
$ sof/src/audio/dai-zephyr.c: In function 'dai_dma_cb': $ sof_dir/sof/src/audio/dai-zephyr.c:259:35: warning: unused variable 'sink_list' [-Wunused-variable]
259 | struct list_item *sink_list;
| ^~~~~~~~~