[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <s5haankqb44.wl%tiwai@suse.de>
Date: Tue, 14 Sep 2010 23:16:43 +0200
From: Takashi Iwai <tiwai@...e.de>
To: Arnd Bergmann <arnd@...db.de>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH 6/7] sound: autoconvert trivial BKL users to private mutex
At Tue, 14 Sep 2010 21:53:41 +0200,
Arnd Bergmann wrote:
>
> 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@...db.de>
> Cc: Takashi Iwai <tiwai@...e.de>
Through a quick look over the patch and the actual driver codes,
I found no obvious problems, so I applied it now to sound git tree.
thanks,
Takashi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists