kernel-fxtec-pro1x/drivers/isdn/mISDN
Arnd Bergmann 76a64921da isdn: autoconvert trivial BKL users to private mutex
All these files use the big kernel lock in a trivial
way to serialize their private file operations,
typically resulting from an earlier semi-automatic
pushdown from VFS.

None of these drivers appears to want to lock against
other code, and they all use the BKL as the top-level
lock in their file operations, meaning that there
is no lock-order inversion problem.

Consequently, we can remove the BKL completely,
replacing it with a per-file mutex in every case.
Using a scripted approach means we can avoid
typos.

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>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-12 20:21:47 -07:00
..
clock.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
core.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
core.h mISDN: Add ISDN sample clock API to mISDN core 2009-01-09 22:44:27 +01:00
dsp.h mISDN: Fix DTMF detection enable/disable 2009-05-25 00:55:47 -07:00
dsp_audio.c mISDN: Cleanup debug messages 2009-05-25 00:55:45 -07:00
dsp_biquad.h Add mISDN DSP 2008-07-27 01:56:38 +02:00
dsp_blowfish.c Add mISDN DSP 2008-07-27 01:56:38 +02:00
dsp_cmx.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
dsp_core.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
dsp_dtmf.c mISDN: Fix DTMF detection enable/disable 2009-05-25 00:55:47 -07:00
dsp_ecdis.h mISDN: Cleanup debug messages 2009-05-25 00:55:45 -07:00
dsp_hwec.c drivers/isdn/mISDN: use ARRAY_SIZE 2008-12-03 20:59:57 -08:00
dsp_hwec.h Add mISDN DSP 2008-07-27 01:56:38 +02:00
dsp_pipeline.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
dsp_tones.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
fsm.c
fsm.h
hwchannel.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
Kconfig trivial: fix typos/grammar errors in Kconfig texts 2009-03-30 15:22:01 +02:00
l1oip.h mISDN: Use kernel_{send,recv}msg instead of open coding 2009-05-25 00:55:46 -07:00
l1oip_codec.c mISDN: DSP now uses ring buffer for echo canceler 2009-05-25 00:51:30 -07:00
l1oip_core.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
layer1.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
layer1.h
layer2.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
layer2.h mISDN: Fix TEI and SAPI handling 2009-05-25 00:51:35 -07:00
Makefile mISDN: Add ISDN sample clock API to mISDN core 2009-01-09 22:44:27 +01:00
socket.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
stack.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
tei.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
timerdev.c isdn: autoconvert trivial BKL users to private mutex 2010-07-12 20:21:47 -07:00