ALSA: pcm: Simplify success check in snd_pcm_open_file()

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 <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260914095248.33391-1-phucduc.bui@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
bui duc phuc 2026-09-14 16:52:48 +07:00 committed by Takashi Iwai
parent eccc0dc233
commit 5b6ea1bb8a

View File

@ -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) {