[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 RFC 3/3] util/uri.c: wrap single statement bl
From: |
Thomas Huth |
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 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
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 <address@hidden>
> Suggested-by: Eric Blake <address@hidden>
> Signed-off-by: Su Hang <address@hidden>
> ---
> util/uri.c | 463
> +++++++++++++++++++++++++++++++++++++++----------------------
> 1 file changed, 294 insertions(+), 169 deletions(-)
Reviewed-by: Thomas Huth <address@hidden>
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 <address@hidden>
Thank you very much for cleaning up that huge file!
Thomas
- [Qemu-devel] [PATCH v4 RFC 0/3] util/uri.c: Coding style format, Su Hang, 2018/02/24
- [Qemu-devel] [PATCH v4 RFC 2/3] util/uri.c: remove brackets that wrap `return` statement's content., Su Hang, 2018/02/24
- [Qemu-devel] [PATCH v4 RFC 3/3] util/uri.c: wrap single statement blocks with braces {}, Su Hang, 2018/02/24
- [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/24
- Re: [Qemu-devel] [PATCH v4 RFC 0/3] util/uri.c: Coding style format, no-reply, 2018/02/25
- [Qemu-devel] [PATCH v4 RFC 0/3] util/uri.c: Coding style format, Su Hang, 2018/02/24
- [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/24
- Re: [Qemu-devel] [PATCH v4 RFC 0/3] util/uri.c: Coding style format, no-reply, 2018/02/24
- Re: [Qemu-devel] [PATCH v4 RFC 0/3] util/uri.c: Coding style format, no-reply, 2018/02/25
- Re: [Qemu-devel] [PATCH v4 RFC 0/3] util/uri.c: Coding style format, Stefan Hajnoczi, 2018/02/27