WSL2-Linux-Kernel/sound/oss/dmasound
Arnd Bergmann 645ef9ef1f sound: autoconvert trivial BKL users to private mutex
The usage of the BKL in the OSS sound drivers is
trivial, and each of them only locks against itself,
so it can be turned into per-driver mutexes.

This is the script that was used for the conversion:

file=$1
name=$2
if grep -q lock_kernel ${file} ; then
    if grep -q 'include.*linux.mutex.h' ${file} ; then
            sed -i '/include.*<linux\/smp_lock.h>/d' ${file}
    else
            sed -i 's/include.*<linux\/smp_lock.h>.*$/include <linux\/mutex.h>/g' ${file}
    fi
    sed -i ${file} \
        -e "/^#include.*linux.mutex.h/,$ {
                1,/^\(static\|int\|long\)/ {
                     /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);

} }"  \
    -e "s/\(un\)*lock_kernel\>[ ]*()/mutex_\1lock(\&${name}_mutex)/g" \
    -e '/[      ]*cycle_kernel_lock();/d'
else
    sed -i -e '/include.*\<smp_lock.h\>/d' ${file}  \
                -e '/cycle_kernel_lock()/d'
fi

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-14 23:14:50 +02:00
..
Kconfig sound: make OSS sound core optional 2008-08-29 10:06:21 +02:00
Makefile The next round of scheduled OSS code removal 2007-10-18 14:37:26 -07:00
dmasound.h oss: fix O_NONBLOCK in dmasound_core 2008-11-01 12:40:38 -07:00
dmasound_atari.c sound: Add missing spin_unlock 2010-05-27 09:47:02 +02:00
dmasound_core.c sound: autoconvert trivial BKL users to private mutex 2010-09-14 23:14:50 +02:00
dmasound_paula.c m68k: amiga - Sound platform device conversion 2010-05-17 21:37:44 +02:00
dmasound_q40.c m68k: dmasound - Kill warn_unused_result warnings 2009-01-12 20:56:42 +01:00