[alsa-devel] [PATCH alsa-lib 0/1] bug fix and comment on "switch"
borneo.antonio at gmail.com
Sat May 12 18:06:22 CEST 2012
this is a very simple one line patch but the issue was
driving me crazy for few days.
After this finding, I have reviewed all the "switch"
statements in alsa-lib. All well done with proper comment
when a "case" falls through the next "case".
But there is one "switch" that does not follow the usual
In file src/pcm/pcm_dsnoop.c
following code fragment:
err = snd_pcm_dsnoop_sync_ptr(pcm);
if (err < 0)
*delayp = snd_pcm_mmap_capture_hw_avail(pcm);
If snd_pcm_dsnoop_sync_ptr() returns no error, execution
falls through next "case".
It's missing the usual comment
/* Fall through */
to highlight such code behavior.
I think the code is correct, but I do not have enough
experience on alsa-lib to be sure. Please confirm.
In such case, I would suggest adding the comment above.
More information about the Alsa-devel