-
Notifications
You must be signed in to change notification settings - Fork 349
audio: dai-zephyr: Fix unused variable warning #8723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
67560e4 to
5be9f22
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
src/audio/dai-zephyr.c
Outdated
| } else { | ||
| #if CONFIG_IPC_MAJOR_4 | ||
| struct list_item *sink_list; | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo Marc, please move line 259 after line 270, this will make code looks more integrity.
|
@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>
5be9f22 to
ceea32c
Compare
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;
| ^~~~~~~~~