qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Su Hang <suhang16@mails.ucas.ac.cn>, boxafox@163.com
Cc: qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v4 RFC 3/3] util/uri.c: wrap single statement blocks with braces {}
Date: Mon, 26 Feb 2018 07:49:46 +0100	[thread overview]
Message-ID: <eff138d4-b83b-80f0-34c7-90bbf002f0b3@redhat.com> (raw)
In-Reply-To: <1519533358-13759-4-git-send-email-suhang16@mails.ucas.ac.cn>

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 <thuth@redhat.com>
> Suggested-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Su Hang <suhang16@mails.ucas.ac.cn>
> ---
>  util/uri.c | 463 +++++++++++++++++++++++++++++++++++++++----------------------
>  1 file changed, 294 insertions(+), 169 deletions(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>

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 <thuth@redhat.com>

Thank you very much for cleaning up that huge file!

 Thomas

  reply	other threads:[~2018-02-26  6:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-25  4:35 [Qemu-devel] [PATCH v4 RFC 0/3] util/uri.c: Coding style format Su Hang
2018-02-25  4:35 ` [Qemu-devel] [PATCH v4 RFC 1/3] util/uri.c: Coding style check, Only whitespace involved. Using `clang-format -i util/uri.c` first, then change back few code manually, to make sure only whitespace involved Su Hang
2018-02-26  6:32   ` Thomas Huth
2018-02-25  4:35 ` [Qemu-devel] [PATCH v4 RFC 2/3] util/uri.c: remove brackets that wrap `return` statement's content Su Hang
2018-02-26  6:39   ` Thomas Huth
2018-02-25  4:35 ` [Qemu-devel] [PATCH v4 RFC 3/3] util/uri.c: wrap single statement blocks with braces {} Su Hang
2018-02-26  6:49   ` Thomas Huth [this message]
2018-02-26  7:19     ` Su Hang
2018-02-25  4:51 ` [Qemu-devel] [PATCH v4 RFC 0/3] util/uri.c: Coding style format no-reply
2018-02-25  4:57 ` no-reply
2018-02-25 20:56   ` Thomas Huth
2018-02-26  2:09     ` Fam Zheng
2018-02-27 15:52 ` Stefan Hajnoczi
  -- strict thread matches above, loose matches on Subject: below --
2018-02-25  4:29 Su Hang
2018-02-25  4:29 ` [Qemu-devel] [PATCH v4 RFC 3/3] util/uri.c: wrap single statement blocks with braces {} Su Hang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eff138d4-b83b-80f0-34c7-90bbf002f0b3@redhat.com \
    --to=thuth@redhat.com \
    --cc=boxafox@163.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=suhang16@mails.ucas.ac.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).