From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MlyHj-0005Fv-1k for qemu-devel@nongnu.org; Fri, 11 Sep 2009 01:02:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MlyHe-00059I-4p for qemu-devel@nongnu.org; Fri, 11 Sep 2009 01:02:58 -0400 Received: from [199.232.76.173] (port=57585 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MlyHd-00058s-PO for qemu-devel@nongnu.org; Fri, 11 Sep 2009 01:02:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48653) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MlyHd-00004t-1k for qemu-devel@nongnu.org; Fri, 11 Sep 2009 01:02:53 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8B52ptQ003802 for ; Fri, 11 Sep 2009 01:02:51 -0400 Date: Fri, 11 Sep 2009 08:01:14 +0300 From: "Michael S. Tsirkin" Subject: Re: braces [was Re: [Qemu-devel] [PATCH 03/19] Remove double error message in qemu_option_set()] Message-ID: <20090911050114.GB1613@redhat.com> References: <1252595941-15196-1-git-send-email-markmc@redhat.com> <1252595941-15196-4-git-send-email-markmc@redhat.com> <20090910180312.GD521@redhat.com> <1252607769.3403.62.camel@blaa> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1252607769.3403.62.camel@blaa> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark McLoughlin Cc: qemu-devel@nongnu.org On Thu, Sep 10, 2009 at 07:36:09PM +0100, Mark McLoughlin wrote: > On Thu, 2009-09-10 at 21:03 +0300, Michael S. Tsirkin wrote: > > On Thu, Sep 10, 2009 at 04:18:45PM +0100, Mark McLoughlin wrote: > > > qemu_opt_set() prints an error message in all failure cases, so > > > qemu_set_option() doesn't need to print another error. > > > > > > Signed-off-by: Mark McLoughlin > > > > Same comment about {} here > > That's 3 of these you and Juan have found. And, genuinely, I try not to > do this. Just shows how much of reflex it is. > > IMHO, > > if (blaa(foo, bar, doodah) == NULL) > return -1; > > is far nicer than: > > if (blaa(foo, bar, doodah) == NULL) { > return -1; > } > > but OTOH, this: > > if (blaa(foo, bar, doodah) == NULL) { > return doodah(foo, bar, blaa); > } > > *is* arguably better than: > > if (blaa(foo, bar, doodah) == NULL) > return doodah(foo, bar, blaa); And if (!blaa(foo, bar, doodah)) is even better :) > There's enough of both ways in the code that I think either should be > acceptable. > > Cheers, > Mark.