Skip to contentSkip to conversation

ALSA: pcm: oss: Use guard() for spin locks

PATCH New Takashi Iwai 1 participant 1 message Aug 27, 2025 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: pcm: oss: Use guard() for spin locks

Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

---
 sound/core/oss/pcm_oss.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
sound/core/oss/pcm_oss.c +1 -2
index 4ecb17bd5436..a82dd155e1d3 100644
@@ -2002,9 +2002,8 @@ static int snd_pcm_oss_set_fragment(struct snd_pcm_oss_file *pcm_oss_file, unsig
 
 static int snd_pcm_oss_nonblock(struct file * file)
 {
-	spin_lock(&file->f_lock);
+	guard(spinlock)(&file->f_lock);
 	file->f_flags |= O_NONBLOCK;
-	spin_unlock(&file->f_lock);
 	return 0;
 }
 
Signature · 1 line
2.50.1