Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752209AbXLCSq3 (ORCPT ); Mon, 3 Dec 2007 13:46:29 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751523AbXLCSqW (ORCPT ); Mon, 3 Dec 2007 13:46:22 -0500 Received: from gateway-1237.mvista.com ([63.81.120.158]:20000 "EHLO gateway-1237.mvista.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751481AbXLCSqV (ORCPT ); Mon, 3 Dec 2007 13:46:21 -0500 Subject: Re: [PATCH] isapnp driver semaphore to mutex From: Daniel Walker To: Ingo Molnar Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux@bohmer.net, jonathan@jonmasters.org In-Reply-To: <20071203164751.GB16135@elte.hu> References: <20071203153743.119714913@mvista.com> <20071203155753.GA32546@elte.hu> <1196697144.1568.1.camel@jnielson-xp.ddns.mvista.com> <20071203164751.GB16135@elte.hu> Content-Type: text/plain Date: Mon, 03 Dec 2007 10:35:01 -0800 Message-Id: <1196706902.1568.11.camel@jnielson-xp.ddns.mvista.com> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-4.fc7) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2081 Lines: 53 On Mon, 2007-12-03 at 17:47 +0100, Ingo Molnar wrote: > * Daniel Walker wrote: > > > On Mon, 2007-12-03 at 16:57 +0100, Ingo Molnar wrote: > > > * Daniel Walker wrote: > > > > > > > Changed the isapnp semaphore to a mutex. > > > > > > cool - i'll give it a whirl. > > > > > > small immaterial nit: > > > > > > > Signed-Off-By: Daniel Walker > > > > > > it's Signed-off-by (note the capitalization). Having this consistent > > > makes scripting around patches a tiny bit easier. > > > > Yeah, I know about it but sometimes still slips by.. > > it's worth automating these repetative bits. I use small templates when > creating patches. Also, it's worth running patches through > scripts/checkpatch.pl - it has a check for exactly this typo. [ Not a > big issue at all, i just mentioned it in case you get a taste for > sending more sem2mutex patches :-) ] > Speaking of automating.. I created a little .vimrc add-on which helps doing sem2mutex type changes. Here's the chunk I added, function Semtomutex( lo ) exe '%s/down(&'.a:lo.')/mutex_lock\(\&'.a:lo.'\)/g' exe '%s/down_trylock(&'.a:lo.')/mutex_trylock\(\&'.a:lo.'\)/g' exe '%s/up(&'.a:lo.')/mutex_unlock\(\&'.a:lo.'\)/g' exe '%s/DECLARE_MUTEX('.a:lo.')/DEFINE_MUTEX\('.a:lo.'\)/g' endfunction map o :call Semtomutex("") I just finished this about 30 seconds ago, and although I tested it once I would guess it might have some bugs.. If you add it to your .vimrc , then you move your cursor over the lock name and hit Ctrl-\-o ,it will convert all the calls for that lock name.. The list of calls it converts isn't complete tho (down, down_trylock, and up) .. I hope people still review the lock usage tho, since it's critical. Daniel -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/