[ALSA] pcm_lib: fix sparse warning about shadowing 'n' symbol

pcm_lib: fix sparse warning about shadowing 'n' symbol

Signed-off-by: Marcin Ślusarz <marcin.slusarz@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Marcin Ślusarz 2007-12-14 12:52:53 +01:00 committed by Jaroslav Kysela
parent 757d5a7561
commit be3e0115e3

View file

@ -1497,14 +1497,18 @@ void snd_pcm_tick_prepare(struct snd_pcm_substream *substream)
avail = snd_pcm_capture_avail(runtime); avail = snd_pcm_capture_avail(runtime);
} }
if (avail < runtime->control->avail_min) { if (avail < runtime->control->avail_min) {
snd_pcm_sframes_t n = runtime->control->avail_min - avail; snd_pcm_sframes_t to_avail_min =
if (n > 0 && frames > (snd_pcm_uframes_t)n) runtime->control->avail_min - avail;
frames = n; if (to_avail_min > 0 &&
frames > (snd_pcm_uframes_t)to_avail_min)
frames = to_avail_min;
} }
if (avail < runtime->buffer_size) { if (avail < runtime->buffer_size) {
snd_pcm_sframes_t n = runtime->buffer_size - avail; snd_pcm_sframes_t to_buffer_size =
if (n > 0 && frames > (snd_pcm_uframes_t)n) runtime->buffer_size - avail;
frames = n; if (to_buffer_size > 0 &&
frames > (snd_pcm_uframes_t)to_buffer_size)
frames = to_buffer_size;
} }
if (frames == ULONG_MAX) { if (frames == ULONG_MAX) {
snd_pcm_tick_set(substream, 0); snd_pcm_tick_set(substream, 0);