]> www.infradead.org Git - users/hch/misc.git/commitdiff
ALSA: pcm: oss: Use guard() for spin locks
authorTakashi Iwai <tiwai@suse.de>
Wed, 27 Aug 2025 08:06:13 +0000 (10:06 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 27 Aug 2025 08:14:20 +0000 (10:14 +0200)
Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Link: https://patch.msgid.link/20250827080618.7682-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/oss/pcm_oss.c

index 4ecb17bd5436e7829d607e0be03c794768eb4632..a82dd155e1d3a630a33d828c847f54fc3e925d31 100644 (file)
@@ -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;
 }