[PATCH] ALSA: pcm: Simplify success check in snd_pcm_open_file()

From: phucduc . bui

Date: Mon Sep 14 2026 - 05:53:11 EST


From: bui duc phuc <phucduc.bui@xxxxxxxxx>

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@xxxxxxxxx>
---
sound/core/pcm_native.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 62324282fcae..000e926a1e6a 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -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) {
--
2.43.0