ALSA: pcm: Simplify success check in snd_pcm_open_file()
PATCH 1/1 ALSA: pcm: Simplify success check in snd_pcm_open_file()
From: bui duc phuc <[email protected]>
snd_pcm_open_file() returns zero on success and a negative error code on failure. Use !err to check for a successful return instead of checking for a non-negative value.
Signed-off-by bui duc phuc <[email protected]>
--- sound/core/pcm_native.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/core/pcm_native.c +1 -1
@@ -2930,7 +2930,7 @@ static int snd_pcm_open(struct file *file, struct snd_pcm *pcm, int stream)mutex_lock (&pcm->open_mutex);while (1 ) { err =snd_pcm_open_file (file, pcm, stream); -if (err >=0 ) +if (!err)break ;if (err == -EAGAIN ) {if (file->f_flags &O_NONBLOCK ) {
Signature · 1 line
2.43.0
Takashi Iwai
AppliedQuoted 8 lines · On Mon, 14 Sep 2026 11:52:48 +0200, [email protected] wrote:
From: bui duc phuc <[email protected]>
snd_pcm_open_file()returns zero on success and a negative error code on failure. Use !err to check for a successful return instead of checking for a non-negative value.Signed-off-by bui duc phuc <[email protected]>
Applied to for-next branch now. Thanks.
Takashi