mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
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:
parent
eccc0dc233
commit
5b6ea1bb8a
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user