From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758577AbXFVP4R (ORCPT ); Fri, 22 Jun 2007 11:56:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757312AbXFVP4D (ORCPT ); Fri, 22 Jun 2007 11:56:03 -0400 Received: from ug-out-1314.google.com ([66.249.92.170]:52334 "EHLO ug-out-1314.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757348AbXFVP4B (ORCPT ); Fri, 22 Jun 2007 11:56:01 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:from:to:cc:subject:message-id:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=CwsgMOl96bIbWd50/44NBgNZEzv3hwAX6VbxtxJeoFXyQsygoLw8u2UDeSF2h1IOmfiQCqxf7YFf2W5GKKvXJMRq1BKej5WundvZDS3syHgzHIPZSYZRMTeTMWRzU1XmV9JGsom6y6w5131jWU3F3eREE4ope94R4FpOrzAq4L8= Date: Fri, 22 Jun 2007 19:54:09 +0400 From: Cyrill Gorcunov To: Jeremy Fitzhardinge Cc: Jesper Juhl , Cyrill Gorcunov , LKML Subject: Re: [PATCH] bracing the loop in kernel/softirq.c Message-ID: <20070622155409.GA8283@cvg> References: <20070620175737.GA6523@cvg> <9a8748490706201401m36b1e917g5a600951d48e4cf8@mail.gmail.com> <467AC8E9.1000605@goop.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <467AC8E9.1000605@goop.org> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org [Jeremy Fitzhardinge - Thu, Jun 21, 2007 at 11:52:25AM -0700] > Jesper Juhl wrote: >> On 20/06/07, Cyrill Gorcunov wrote: >>> This trivial patch adds braces over a one-line >>> loop. That makes code...well... little bit >>> convenient for (possible) further modifications. >>> >> That's generally not done. >> >> It's even in Documentation/CodingStyle : >> >> " >> Do not unnecessarily use braces where a single statement will do. >> >> if (condition) >> action(); >> " > > I tend to see "do {} while()" as an exception to this. I find the > construct is sufficiently rare that it helps to emphasize it a bit. For > example if I'm scanning code and I see: > > while (foo != NULL); > > in the corner of my eye, I'm going to think "huh?". But: > > } while (foo != NULL); > > visually "parses" properly, regardless of how near or far the corresponding > "do {" is. > > (And of course, its consistent with the super extra special while-while > loop: > > while (foo != NULL) { > foo = bar(); > piffle(); > } while (foo != NULL); // make sure we loop properly > > ;) > > J > Btw, Jeremy, could you please Ack it then and I'll resend the patch to Andrew ;) Cyrill