From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqCbq-0003NO-3R for qemu-devel@nongnu.org; Mon, 26 Feb 2018 01:50:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eqCbn-0001ue-1P for qemu-devel@nongnu.org; Mon, 26 Feb 2018 01:50:02 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34102 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eqCbm-0001uZ-SX for qemu-devel@nongnu.org; Mon, 26 Feb 2018 01:49:58 -0500 References: <1519533358-13759-1-git-send-email-suhang16@mails.ucas.ac.cn> <1519533358-13759-4-git-send-email-suhang16@mails.ucas.ac.cn> From: Thomas Huth Message-ID: Date: Mon, 26 Feb 2018 07:49:46 +0100 MIME-Version: 1.0 In-Reply-To: <1519533358-13759-4-git-send-email-suhang16@mails.ucas.ac.cn> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 RFC 3/3] util/uri.c: wrap single statement blocks with braces {} List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Su Hang , boxafox@163.com Cc: qemu-devel@nongnu.org, Stefan Hajnoczi On 25.02.2018 05:35, Su Hang wrote: > For this patch, using curly braces to wrap `if` `while` `else` statements, > which only hold single statement. For example: > ''' > if (cond) > statement; > ''' > to > ''' > if (cond) { > statement; > } > ''' > > And using tricks that compare the disassemblies before and after > code changes, to make sure code logic isn't changed: > ''' > git checkout master > make util/uri.o > strip util/uri.o > objdump -Drx util/uri.o > /tmp/uri-master.txt > git checkout cleanupbranch > make util/uri.o > strip util/uri.o > objdump -Drx util/uri.o > /tmp/uri-cleanup.txt > diff -u /tmp/uri-*.txt > ''' > > With that, all complaints raised by checkpatch.pl have been suppressed. > > Suggested-by: Thomas Huth > Suggested-by: Eric Blake > Signed-off-by: Su Hang > --- > util/uri.c | 463 +++++++++++++++++++++++++++++++++++++++---------------------- > 1 file changed, 294 insertions(+), 169 deletions(-) Reviewed-by: Thomas Huth I've also checked again with the "objdump" trick that there are no differences in the generated code, and indeed, looks good now, so I think I can also say: Tested-by: Thomas Huth Thank you very much for cleaning up that huge file! Thomas