From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M6gUw-0001Bx-Jz for qemu-devel@nongnu.org; Wed, 20 May 2009 03:45:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M6gUr-0001AB-4z for qemu-devel@nongnu.org; Wed, 20 May 2009 03:45:57 -0400 Received: from [199.232.76.173] (port=51522 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M6gUq-0001A8-VV for qemu-devel@nongnu.org; Wed, 20 May 2009 03:45:53 -0400 Received: from mx20.gnu.org ([199.232.41.8]:12354) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M6gUq-0003YX-Cz for qemu-devel@nongnu.org; Wed, 20 May 2009 03:45:52 -0400 Received: from mx2.redhat.com ([66.187.237.31]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M6gUp-00071s-7s for qemu-devel@nongnu.org; Wed, 20 May 2009 03:45:51 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n4K7jo2v020405 for ; Wed, 20 May 2009 03:45:50 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n4K7jn33028206 for ; Wed, 20 May 2009 03:45:50 -0400 Received: from dhcp-5-188.str.redhat.com (dhcp-5-245.str.redhat.com [10.32.5.245]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n4K7jmpT004328 for ; Wed, 20 May 2009 03:45:49 -0400 Message-ID: <4A13B4F0.3030207@redhat.com> Date: Wed, 20 May 2009 09:44:48 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <200905191830.n4JIUCMB019417@d03av04.boulder.ibm.com> In-Reply-To: <200905191830.n4JIUCMB019417@d03av04.boulder.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [COMMIT 26d64a8] Format per CODING_STYLE List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org" Anthony Liguori schrieb: > From: malc > > Signed-off-by: malc Is it really necessary to have commits that change nothing but style? We could have hundreds of commits just converting all the code to the new coding style, but in the end all you achieve is to clutter up the log and make git blame meaningless. I would really prefer to apply the new coding style only to new or (semantically) changed code. Kevin > > diff --git a/qemu-malloc.c b/qemu-malloc.c > index 5e9f47f..295d185 100644 > --- a/qemu-malloc.c > +++ b/qemu-malloc.c > @@ -26,8 +26,9 @@ > > static void *oom_check(void *ptr) > { > - if (ptr == NULL) > + if (ptr == NULL) { > abort(); > + } > return ptr; > } > > @@ -43,18 +44,20 @@ void qemu_free(void *ptr) > > void *qemu_malloc(size_t size) > { > - if (!size) > + if (!size) { > abort(); > + } > return oom_check(malloc(size)); > } > > void *qemu_realloc(void *ptr, size_t size) > { > - if (size) > + if (size) { > return oom_check(realloc(ptr, size)); > - else { > - if (ptr) > + } else { > + if (ptr) { > return realloc(ptr, size); > + } > } > abort(); > } > @@ -81,8 +84,9 @@ char *qemu_strndup(const char *str, size_t size) > const char *end = memchr(str, 0, size); > char *new; > > - if (end) > + if (end) { > size = end - str; > + } > > new = qemu_malloc(size + 1); > new[size] = 0; > >