Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ALSA: usb: fcp: Use guard() for spin locks

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

Merely code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

+7 -10
+7 -10
sound/usb/fcp.c
··· 820 820 { 821 821 struct usb_mixer_interface *mixer = hw->private_data; 822 822 struct fcp_data *private = mixer->private_data; 823 - unsigned long flags; 824 823 long ret = 0; 825 824 u32 event; 826 825 ··· 831 832 if (ret) 832 833 return ret; 833 834 834 - spin_lock_irqsave(&private->notify.lock, flags); 835 - event = private->notify.event; 836 - private->notify.event = 0; 837 - spin_unlock_irqrestore(&private->notify.lock, flags); 835 + scoped_guard(spinlock_irqsave, &private->notify.lock) { 836 + event = private->notify.event; 837 + private->notify.event = 0; 838 + } 838 839 839 840 if (copy_to_user(buf, &event, sizeof(event))) 840 841 return -EFAULT; ··· 945 946 } 946 947 947 948 if (data) { 948 - unsigned long flags; 949 - 950 - spin_lock_irqsave(&private->notify.lock, flags); 951 - private->notify.event |= data; 952 - spin_unlock_irqrestore(&private->notify.lock, flags); 949 + scoped_guard(spinlock_irqsave, &private->notify.lock) { 950 + private->notify.event |= data; 951 + } 953 952 954 953 wake_up_interruptible(&private->notify.queue); 955 954 }