From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754364Ab0INVQp (ORCPT ); Tue, 14 Sep 2010 17:16:45 -0400 Received: from cantor2.suse.de ([195.135.220.15]:59341 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751479Ab0INVQo (ORCPT ); Tue, 14 Sep 2010 17:16:44 -0400 Date: Tue, 14 Sep 2010 23:16:43 +0200 Message-ID: From: Takashi Iwai To: Arnd Bergmann Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/7] sound: autoconvert trivial BKL users to private mutex In-Reply-To: <1284494022-7346-7-git-send-email-arnd@arndb.de> References: <1284494022-7346-1-git-send-email-arnd@arndb.de> <1284494022-7346-7-git-send-email-arnd@arndb.de> User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.1 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.*/d' ${file} > else > sed -i 's/include.*.*$/include /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.*\/d' ${file} \ > -e '/cycle_kernel_lock()/d' > fi > > Signed-off-by: Arnd Bergmann > Cc: Takashi Iwai 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