Re: [Qemu-devel] [Qemu-arm] [PATCH v3 7/7] Add QTest testcase for the Intel Hexadecimal

2018-07-27 Thread Su Hang
> 0xe1, > 0x00, 0x10, 0x1f, 0x10, 0x00, 0x48, 0x2d, 0xe9, 0x04, 0xb0, 0x8d, > 0xe2, > 0x08, 0x00, 0x9f, 0xe5, 0xe6, 0xff, 0xff, 0xeb, 0x00, 0x00, 0xa0, > 0xe1, > 0x00, 0x88, 0xbd, 0xe8, 0x84, 0x00, 0x01, 0x00, 0x00, 0x10, 0x1f, > 0x10, > 'H', 'e', 'l', 'l','o', ' ', 'w', 'o','r', 'l', 'd', '!', > '\n', '\0' > }; > > ? Yes, good suggestion. Your version is clearer and more readable for humans. Best, Su Hang

Re: [Qemu-devel] [PATCH] loader: implement START_SEG_ADDR_RECORD

2018-06-13 Thread Su Hang
s; if not, I will implement it after my task get finished. Sincerely sorry for the trouble I might made. SU Hang > -Original Messages- > From: "Stefan Hajnoczi" > Sent Time: 2018-06-11 21:55:07 (Monday) > To: "Su Hang" > Cc: qemu-devel@nongnu.org, jus

Re: [Qemu-devel] [PATCH] loader: implement START_SEG_ADDR_RECORD

2018-06-11 Thread Su Hang
For example, in my past patch serias, "Hello World!" will be printed out, if Hex File get successfully loaded. Julia has told me a method, I haven't tried it. I will do it as quick as I could. Best, Su Hang > -Original Messages- > From: "Stefan Hajnoczi"

Re: [Qemu-devel] [PATCH] loader: implement START_SEG_ADDR_RECORD

2018-06-09 Thread Su Hang
Sure, Thanks for remind me of this. One thing I must point out, in current code logic, if "START_SEG_ADDR_RECORD" occured multiple times, only the last one works. I don't know whether GNU binutils would emit 'The Record' many times. Best, SU Hang > -Original M

Re: [Qemu-devel] [PULL 1/2] Implement .hex file loader

2018-05-24 Thread Su Hang
ned me about this. But at that time, I was thinking about "get this patch merged first, then add support for armv7m". I am wrong. SU Hang > -Original Messages- > From: "Peter Maydell" > Sent Time: 2018-05-24 22:40:04 (Thursday) > To: "Su Hang"

Re: [Qemu-devel] [PULL 2/2] Add QTest testcase for the Intel Hexadecimal

2018-05-24 Thread Su Hang
Sure, I will list other involved files. Thanks for you suggestion. SU Hang "Eric Blake" wrote: > On 05/24/2018 06:29 AM, Su Hang wrote: > > 'test.hex' file is a bare metal ARM software stored in Hexadecimal > > Object Format. When it's loaded by QEM

[Qemu-devel] [PULL 0/2] Implement Hex file loader and add test case

2018-05-24 Thread Su Hang
tream for you to fetch changes up to a9120811a5b9109d79f704e0a79fb851860e9f04: Add QTest testcase for the Intel Hexadecimal Object File Loader. (2018-05-24 18:54:02 +0800) -------- Su Hang (2): Implement .hex file loader Add QTes

[Qemu-devel] [PULL 2/2] Add QTest testcase for the Intel Hexadecimal

2018-05-24 Thread Su Hang
h is used to verify correctness. Reviewed-by: Stefan Hajnoczi Suggested-by: Steffen Gortz Suggested-by: Stefan Hajnoczi Signed-off-by: Su Hang --- MAINTAINERS | 6 configure| 4 +++ tests/Makefile.include | 2 ++ tests/hex-lo

[Qemu-devel] [PULL 1/2] Implement .hex file loader

2018-05-24 Thread Su Hang
, etc. Reviewed-by: Stefan Hajnoczi Suggested-by: Stefan Hajnoczi Signed-off-by: Su Hang --- hw/arm/boot.c | 7 +- hw/core/loader.c| 246 include/hw/loader.h | 12 +++ 3 files changed, 264 insertions(+), 1 deletion(-) diff --git a

[Qemu-devel] [PATCH v9 1/2] Implement .hex file loader

2018-05-15 Thread Su Hang
, etc. Reviewed-by: Stefan Hajnoczi Suggested-by: Stefan Hajnoczi Signed-off-by: Su Hang --- hw/arm/boot.c | 7 +- hw/core/loader.c| 246 include/hw/loader.h | 12 +++ 3 files changed, 264 insertions(+), 1 deletion(-) diff --git a

[Qemu-devel] [PATCH v9 2/2] Add QTest testcase for the Intel Hexadecimal Object File Loader.

2018-05-15 Thread Su Hang
h is used to verify correctness. Reviewed-by: Stefan Hajnoczi Suggested-by: Steffen Gortz Suggested-by: Stefan Hajnoczi Signed-off-by: Su Hang --- MAINTAINERS | 6 configure| 4 +++ tests/Makefile.include | 2 ++ tests/hex-lo

[Qemu-devel] [PATCH v9 0/2] Implement Hex file loader and add test case

2018-05-15 Thread Su Hang
_blob_as`, replace it with `rom_add_blob_fixed_as`, because they are equivalent; v9: -- Modify 'configure' file and test data file path in 'hexloader-test.c' to support 'hexloader-test.c' out-of-tree builds and run; Su Hang (2): Implement .hex file load

Re: [Qemu-devel] [PATCH v7 2/2] Add QTest testcase for the Intel Hexadecimal Object File Loader.

2018-05-15 Thread Su Hang
Great! Thanks for your suggestion! Best, SU Hang "Steffen Görtz" wrote: > On 10.05.2018 09:18, Su Hang wrote: > > Hi, > this will be my first comment on devel as part of my GSoC participation > this year. > > > + > > +QTestState *s = qtest_star

[Qemu-devel] [PATCH v8 2/2] Add QTest testcase for the Intel Hexadecimal Object File Loader.

2018-05-14 Thread Su Hang
h is used to verify correctness. Reviewed-by: Stefan Hajnoczi Signed-off-by: Su Hang --- MAINTAINERS | 6 tests/Makefile.include | 2 ++ tests/hex-loader-check-data/test.hex | 12 tests/hexloader-test.c | 56 +++

[Qemu-devel] [PATCH v8 1/2] Implement .hex file loader

2018-05-14 Thread Su Hang
, etc. Suggested-by: Stefan Hajnoczi Signed-off-by: Su Hang --- hw/arm/boot.c | 7 +- hw/core/loader.c| 246 include/hw/loader.h | 12 +++ 3 files changed, 264 insertions(+), 1 deletion(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c

[Qemu-devel] [PATCH v8 0/2] Implement Hex file loader and add test case

2018-05-14 Thread Su Hang
_blob_as`, replace it with `rom_add_blob_fixed_as`, because they are equivalent; Su Hang (2): Implement .hex file loader Add QTest testcase for the Intel Hexadecimal Object File Loader. MAINTAINERS | 6 + hw/arm/boot.c

Re: [Qemu-devel] [PATCH v7 1/2] Implement .hex file loader

2018-05-13 Thread Su Hang
; > and microcontrollers, such as Micro:bit Arduino, ARM, STM32, etc. > > > > The hex format is used mainly by Cortex-M boards. This code doesn't > support them, because armv7m uses its own load function. Could you add > support for armv7m? Sure, I'm willing to help, but in the next patch, not in this patch series. Best, Su Hang

[Qemu-devel] [PATCH v8 2/2] Add QTest testcase for the Intel Hexadecimal Object File Loader.

2018-05-10 Thread Su Hang
h is used to verify correctness. Reviewed-by: Stefan Hajnoczi Signed-off-by: Su Hang --- MAINTAINERS | 6 tests/Makefile.include | 2 ++ tests/hex-loader-check-data/test.hex | 12 tests/hexloader-test.c | 56 +++

[Qemu-devel] [PATCH v8 0/2] Implement Hex file loader and add test case

2018-05-10 Thread Su Hang
_blob_as`, replace it with `rom_add_blob_fixed_as`, because they are equivalent; Su Hang (2): Implement .hex file loader Add QTest testcase for the Intel Hexadecimal Object File Loader. MAINTAINERS | 6 + hw/arm/boot.c

[Qemu-devel] [PATCH v8 1/2] Implement .hex file loader

2018-05-10 Thread Su Hang
, etc. Suggested-by: Stefan Hajnoczi Signed-off-by: Su Hang --- hw/arm/boot.c | 7 +- hw/core/loader.c| 246 include/hw/loader.h | 12 +++ 3 files changed, 264 insertions(+), 1 deletion(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c

[Qemu-devel] [PATCH v7 0/2] Implement Hex file loader and add test case

2018-05-10 Thread Su Hang
arser.line.byte_count) * 2 != record_index)` -- Remove unused field `max_sz`; -- Replace `int` with `size_t` for local variable `total_size` in function `parse_hex_blob` -- Rename function `load_image_targphys_hex_as` argument `addr` to `entry`; Su Hang (2): Implement .hex file loader Add QT

[Qemu-devel] [PATCH v7 2/2] Add QTest testcase for the Intel Hexadecimal Object File Loader.

2018-05-10 Thread Su Hang
ude/hw/core/generic-loader.h F: docs/generic-loader.txt +Intel Hexadecimal Object File Loader +M: Su Hang +S: Maintained +F: tests/hexloader-test.c +F: tests/hex-loader-check-data/test.hex + CHRP NVRAM M: Thomas Huth S: Maintained diff --git a/tests/Makefile.include b/tests/Makefile.include index

[Qemu-devel] [PATCH v7 1/2] Implement .hex file loader

2018-05-10 Thread Su Hang
, etc. Suggested-by: Stefan Hajnoczi Signed-off-by: Su Hang --- hw/arm/boot.c | 10 ++- hw/core/loader.c| 246 include/hw/loader.h | 15 3 files changed, 269 insertions(+), 2 deletions(-) diff --git a/hw/arm/boot.c b/hw/arm

Re: [Qemu-devel] [PATCH v6 1/2] Implement .hex file loader

2018-05-07 Thread Su Hang
should I use `long long` instead of `int`? Su Hang

Re: [Qemu-devel] [PATCH v6 1/2] Implement .hex file loader

2018-04-30 Thread Su Hang
> A malicious input file can control the following values: > * record_index using whitespace (see "case default" below) > * byte_count in range [0x00, 0xff] > * our_checksum = 0 by choosing the right address field values Oh, that is really a disaster... Thanks for

[Qemu-devel] [PATCH v6 2/2] Add QTest testcase for the Intel Hexadecimal Object File Loader.

2018-04-26 Thread Su Hang
ude/hw/core/generic-loader.h F: docs/generic-loader.txt +Intel Hexadecimal Object File Loader +M: Su Hang +S: Maintained +F: tests/hexloader-test.c +F: tests/hex-loader-check-data/test.hex + CHRP NVRAM M: Thomas Huth S: Maintained diff --git a/tests/Makefile.include b/tests/Makefile.include index

[Qemu-devel] [PATCH v6 1/2] Implement .hex file loader

2018-04-26 Thread Su Hang
, etc. Suggested-by: Stefan Hajnoczi Signed-off-by: Su Hang --- hw/arm/boot.c | 17 ++-- hw/core/loader.c| 241 include/hw/loader.h | 16 3 files changed, 269 insertions(+), 5 deletions(-) diff --git a/hw/arm/boot.c b/hw/arm

[Qemu-devel] [PATCH v6 0/2] Implement Hex file loader and add test case

2018-04-26 Thread Su Hang
type to store entry point; Su Hang (2): Implement .hex file loader Add QTest testcase for the Intel Hexadecimal Object File Loader. MAINTAINERS | 6 + hw/arm/boot.c| 17 ++- hw/core/loader.c | 241

[Qemu-devel] [PATCH v5 2/2] Add QTest testcase for the Intel Hexadecimal Object File Loader.

2018-04-19 Thread Su Hang
ude/hw/core/generic-loader.h F: docs/generic-loader.txt +Intel Hexadecimal Object File Loader +M: Su Hang +S: Maintained +F: tests/hexloader-test.c +F: tests/hex-loader-check-data/test.hex + CHRP NVRAM M: Thomas Huth S: Maintained diff --git a/tests/Makefile.include b/tests/Makefile.include index

[Qemu-devel] [PATCH v5 1/2] Implement .hex file loader

2018-04-19 Thread Su Hang
. Suggested-by: Stefan Hajnoczi Signed-off-by: Su Hang --- hw/arm/boot.c | 18 ++-- hw/core/loader.c| 253 include/hw/loader.h | 14 +++ 3 files changed, 280 insertions(+), 5 deletions(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index

[Qemu-devel] [PATCH v5 0/2] Implement Hex file loader and add test case

2018-04-19 Thread Su Hang
ype cast; Remove duplicate zero-initialization; Correct typos; Su Hang (2): Implement .hex file loader Add QTest testcase for the Intel Hexadecimal Object File Loader. MAINTAINERS | 6 + hw/arm/boot.c| 18 ++- hw/core/loader.c

Re: [Qemu-devel] [PATCH v4 1/2] Implement .hex file loader

2018-04-16 Thread Su Hang
> -Original Messages- > From: "Su Hang" > Sent Time: 2018-04-16 22:49:48 (Monday) > To: "stefan hajnoczi" > Cc: "jim mussared" , qemu-devel > , "joel stanley" > Subject: Re: [Qemu-devel] [PATCH v4 1/2] Implement .hex file l

Re: [Qemu-devel] [PATCH v4 1/2] Implement .hex file loader

2018-04-16 Thread Su Hang
o_cpu() the first time you suggested it to me, but qemu crashed... I have read other places call this function to verify I use it correctly, but it did crash(that's why I choose bswap16()), It's strange... I'll report more detail about this case tomorrow. Thank you for your patience

Re: [Qemu-devel] [PATCH v4 1/2] Implement .hex file loader

2018-04-14 Thread Su Hang
Thanks for your detailed reply! I will carefully treat all the content that you mentioned, and apply them in v5. > -Original Messages- > From: "Stefan Hajnoczi" > Sent Time: 2018-04-14 22:08:43 (Saturday) > To: "Su Hang" > Cc: "Jim Mussared"

Re: [Qemu-devel] [PATCH 06/19] block: Avoid unnecessary aio_poll() in AIO_WAIT_WHILE()

2018-04-11 Thread Su Hang
Dear Kevin: I notice checkpatch.pl complained about code style problems, you may want to replace `while (aio_poll(bs->aio_context, false));` with ``` while (aio_poll(bs->aio_context, false)) { /* No further work */ } ``` to suppress the complaints. Best, Su Hang "Kevin Wolf"

[Qemu-devel] [PATCH v4 1/2] Implement .hex file loader

2018-04-08 Thread Su Hang
. Suggested-by: Stefan Hajnoczi Signed-off-by: Su Hang --- hw/arm/boot.c | 9 +- hw/core/loader.c| 280 include/hw/loader.h | 17 3 files changed, 305 insertions(+), 1 deletion(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index

[Qemu-devel] [PATCH v4 2/2] Add QTest testcase for the Intel Hexadecimal Object File Loader.

2018-04-08 Thread Su Hang
ude/hw/core/generic-loader.h F: docs/generic-loader.txt +Intel Hexadecimal Object File Loader +M: Su Hang +S: Maintained +F: tests/hexloader-test.c +F: tests/hex-loader-check-data/test.hex + CHRP NVRAM M: Thomas Huth S: Maintained diff --git a/tests/Makefile.include b/tests/Makefile.include index

[Qemu-devel] [PATCH v4 0/2] Implement Hex file loader and add test case

2018-04-08 Thread Su Hang
hexloader-test.c. Su Hang (2): Implement .hex file loader Add QTest testcase for the Intel Hexadecimal Object File Loader. MAINTAINERS | 6 + hw/arm/boot.c| 9 +- hw/core/loader.c | 280 ++

Re: [Qemu-devel] [Qemu-trivial] [PATCH RFC v3 for-2.12?] scripts/checkpatch.pl: Bug fix

2018-04-08 Thread Su Hang
\s*if/) { ``` that wraps '($line =~ /(\}.*)$/)' limits the scope of the match. Best, Su Hang > -Original Messages- > From: "Eric Blake" > Sent Time: 2018-04-05 02:28:13 (Thursday) > To: "Su Hang" , vsement...@virtuozzo.com > Cc: qemu-t

[Qemu-devel] [PATCH v3 2/2] Add QTest testcase for the Intel Hexadecimal Object File Loader.

2018-04-07 Thread Su Hang
ude/hw/core/generic-loader.h F: docs/generic-loader.txt +Intel Hexadecimal Object File Loader +M: Su Hang +S: Maintained +F: tests/hexloader-test.c +F: tests/hex-loader-check-data/test.hex + CHRP NVRAM M: Thomas Huth S: Maintained diff --git a/tests/Makefile.include b/tests/Makefile.include index

[Qemu-devel] [PATCH v3 1/2] Implement .hex file loader

2018-04-07 Thread Su Hang
. Suggested-by: Stefan Hajnoczi Signed-off-by: Su Hang --- hw/arm/boot.c | 9 +- hw/core/loader.c| 280 include/hw/loader.h | 17 3 files changed, 305 insertions(+), 1 deletion(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index

[Qemu-devel] [PATCH v3 0/2] Implement Hex file loader and add test case

2018-04-07 Thread Su Hang
These series of patchs implement Intel Hexadecimal File loader and add QTest testcase to verify the correctness of Loader. v1: Basic version. v2: Replace `do{}while(cond);` block with `for(;;)` block. v3: Add two new files information in MAINTAINERS. Su Hang (2): Implement .hex file loader

[Qemu-devel] [PATCH v3 1/2] Implement .hex file loader

2018-04-07 Thread Su Hang
. Suggested-by: Stefan Hajnoczi Signed-off-by: Su Hang --- hw/arm/boot.c | 9 +- hw/core/loader.c| 280 include/hw/loader.h | 17 3 files changed, 305 insertions(+), 1 deletion(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index

[Qemu-devel] [PATCH v3 RFC 0/2] Implement Hex file loader and add test case

2018-04-07 Thread Su Hang
These series of patchs implement Intel Hexadecimal File loader and add QTest testcase to verify the correctness of Loader. v1: Basic version. v2: Replace `do{}while(cond);` block with `for(;;)` block. v3: Add two new files information in MAINTAINERS. Su Hang (2): Implement .hex file loader

[Qemu-devel] [PATCH v3 2/2] Add QTest testcase for the Intel Hexadecimal Object File Loader.

2018-04-07 Thread Su Hang
ude/hw/core/generic-loader.h F: docs/generic-loader.txt +Intel Hexadecimal Object File Loader +M: Su Hang +S: Maintained +F: tests/hexloader-test.c +F: tests/hex-loader-check-data/test.hex + CHRP NVRAM M: Thomas Huth S: Maintained diff --git a/tests/Makefile.include b/tests/Makefile.include index

Re: [Qemu-devel] [PATCH v2 RFC 0/2] Implement Hex file loader and add test case

2018-04-04 Thread Su Hang
Thanks for your reply! Owning to cultural difference, I used to regard “RFC” as a way of show modest... I will apply your suggestion in v3. Best, Su Hang "Eric Blake" wrote: > On 04/04/2018 10:19 AM, Su Hang wrote: > > These series of patchs implement Intel Hexadecimal File

Re: [Qemu-devel] [PATCH 0/2 RFC] Implement Hex file loader and add test case

2018-04-04 Thread Su Hang
A bit embarrassing, this mistake was introduced by me. I submitted a corresponding patch to fix it, but no one has reviewed it. See link below: http://lists.nongnu.org/archive/html/qemu-devel/2018-03/msg06506.html "Eric Blake" wrote: > On 04/03/2018 10:37 AM, no-re...@patchew.org wrote: > > Hi, >

[Qemu-devel] [PATCH v2 RFC 1/2] Implement .hex file loader

2018-04-04 Thread Su Hang
. Suggested-by: Stefan Hajnoczi Signed-off-by: Su Hang --- hw/arm/boot.c | 9 +- hw/core/loader.c| 280 include/hw/loader.h | 17 3 files changed, 305 insertions(+), 1 deletion(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index

[Qemu-devel] [PATCH v2 RFC 2/2] Add QTest testcase for the Intel Hexadecimal Object File Loader.

2018-04-04 Thread Su Hang
+1,56 @@ +/* + * QTest testcase for the Intel Hexadecimal Object File Loader + * + * Authors: + * Su Hang 2018 + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + */ + +#include "qemu/osdep.h" +

[Qemu-devel] [PATCH v2 RFC 0/2] Implement Hex file loader and add test case

2018-04-04 Thread Su Hang
These series of patchs implement Intel Hexadecimal File loader and add QTest testcase to verify the correctness of Loader. v1: Basic version. v2: Replace `do{}while(cond);` block with `for(;;)` block to suppress code style complain. Su Hang (2): Implement .hex file loader Add QTest testcase

[Qemu-devel] [PATCH 1/2] Implement .hex file loader

2018-04-03 Thread Su Hang
. Suggested-by: Stefan Hajnoczi Signed-off-by: Su Hang --- hw/arm/boot.c | 9 +- hw/core/loader.c| 280 include/hw/loader.h | 17 3 files changed, 305 insertions(+), 1 deletion(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index

[Qemu-devel] [PATCH 0/2 RFC] Implement Hex file loader and add test case

2018-04-03 Thread Su Hang
These series of patchs implement Intel Hexadecimal File loader and add QTest testcase to verify the correctness of Loader. Su Hang (2): Implement .hex file loader Add QTest testcase for the Intel Hexadecimal Object File Loader. hw/arm/boot.c | 9 +- hw/core/loader.c | 280

[Qemu-devel] [PATCH 2/2] Add QTest testcase for the Hex File Loader

2018-04-03 Thread Su Hang
+1,56 @@ +/* + * QTest testcase for the Intel Hexadecimal Object File Loader + * + * Authors: + * Su Hang 2018 + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + */ + +#include "qemu/osdep.h" +

Re: [Qemu-devel] [PATCH v2] scripts/checkpatch.pl: Bug fix

2018-04-03 Thread Su Hang
Please ignore this email, this patch was accidentally sent. "Su Hang" wrote: > checkpatch.pl stops complaining about following pattern: > """ > do { > //do somethins; > } while (conditions); > """ > > One things need to be ment

[Qemu-devel] [PATCH v2] scripts/checkpatch.pl: Bug fix

2018-04-03 Thread Su Hang
mp; $line !~ /\#\s*else/) { """ I'm not sure, please give me some advice. (Sorry, I don't know this patch should base on which commit, so I generate this patch based on commit:fb8446d94ec7a3dc0c3a7e7da672406476f075ac, I choose this by `git log -2 scripts/checkpa

[Qemu-devel] [PATCH 0/2 RFC] Implement Hex file loader and add test case

2018-04-03 Thread Su Hang
These series of patchs implement Intel Hexadecimal File loader and add QTest testcase to verify the correctness of Loader. Su Hang (2): Implement .hex file loader Add QTest testcase for the Intel Hexadecimal Object File Loader. hw/arm/boot.c | 9 +- hw/core/loader.c | 280

[Qemu-devel] [PATCH 2/2] Add QTest testcase for the Hex File Loader

2018-04-03 Thread Su Hang
+1,56 @@ +/* + * QTest testcase for the Intel Hexadecimal Object File Loader + * + * Authors: + * Su Hang 2018 + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + */ + +#include "qemu/osdep.h" +

[Qemu-devel] [PATCH 1/2] Implement .hex file loader

2018-04-03 Thread Su Hang
. Suggested-by: Stefan Hajnoczi Signed-off-by: Su Hang --- hw/arm/boot.c | 9 +- hw/core/loader.c| 280 include/hw/loader.h | 17 3 files changed, 305 insertions(+), 1 deletion(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index

[Qemu-devel] [PATCH RFC v3] scripts/checkpatch.pl: Bug fix

2018-03-25 Thread Su Hang
Commit 2b9aef6fcd96ba7ed8c1ee723e391901852d344c introduced a regression: checkpatch.pl started complaining about the following valid pattern: do { /* something */ } while (condition); Fix the script to once again permit this pattern. Signed-off-by: Su Hang --- v1: fix bug. v2: correct

Re: [Qemu-devel] Should we check arguments for function `from_bcd` and `to_bcd`?

2018-03-22 Thread Su Hang
Thanks for your reply. :-) Su Hang "Paolo Bonzini" wrote: > On 22/03/2018 08:03, Su Hang wrote: > > When I was reading 'qemu/hw/timer/m48t59.c'(Line:328) and run with > > `make check-qtest-ppc`, > > I found when write an invalid value 0xc to address 0x

[Qemu-devel] Should we check arguments for function `from_bcd` and `to_bcd`?

2018-03-22 Thread Su Hang
static inline uint8_t from_bcd(uint8_t val) { return ((val >> 4) * 10) + (val & 0x0f); } """ Su Hang

[Qemu-devel] [PATCH RFC v3] scripts/checkpatch.pl: Bug fix

2018-03-19 Thread Su Hang
Commit 2b9aef6fcd96ba7ed8c1ee723e391901852d344c introduced a regression: checkpatch.pl started complaining about the following valid pattern: do { /* something */ } while (condition); Fix the script to once again permit this pattern. Signed-off-by: Su Hang --- v1: fix bug. v2: correct

[Qemu-devel] [PATCH RFC v2] scripts/checkpatch.pl: Bug fix

2018-03-19 Thread Su Hang
description. Signed-off-by: Su Hang --- scripts/checkpatch.pl | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 57daae05ea18..d52207a3cc9d 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2356,6

Re: [Qemu-devel] [PATCH RFC] scripts/checkpatch.pl: Bug fix

2018-03-19 Thread Su Hang
> -Original Messages- > From: "Eric Blake" > Sent Time: 2018-03-19 23:25:20 (Monday) > To: "Su Hang" , vsement...@virtuozzo.com > Cc: qemu-devel@nongnu.org > Subject: Re: [Qemu-devel] [PATCH RFC] scripts/checkpatch.pl: Bug fix > Having the c

[Qemu-devel] [PATCH RFC] scripts/checkpatch.pl: Bug fix

2018-03-19 Thread Su Hang
Bug fix: checkpatch.pl stops complaining about following pattern: """ do { //do somethins; } while (conditions); """ Signed-off-by: Su Hang --- scripts/checkpatch.pl | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/s

Re: [Qemu-devel] [PATCH v2] scripts/checkpatch.pl: Bug fix

2018-03-16 Thread Su Hang
Thanks for your reply! I'm glad to understand where problem lies. Su Hang > -Original Messages- > From: "Fam Zheng" > Sent Time: 2018-03-16 15:08:19 (Friday) > To: "Su Hang" > Cc: peter.mayd...@linaro.org, vsement...@virtuozzo.com, qemu-dev

Re: [Qemu-devel] [PATCH v2] scripts/checkpatch.pl: Bug fix

2018-03-15 Thread Su Hang
Because I generate my first patch on master, it should work. I have a little trouble understanding what Mr.Peter wants me to do, would you please spare a little of your time and have a look at it? It will help me. Please... Su Hang > -Original Messages- > From: "Fam Zheng&qu

[Qemu-devel] [PATCH v2] scripts/checkpatch.pl: Bug fix

2018-03-15 Thread Su Hang
mp; $line !~ /\#\s*else/) { """ I'm not sure, please give me some advice. (Sorry, I don't know this patch should base on which commit, so I generate this patch based on commit:fb8446d94ec7a3dc0c3a7e7da672406476f075ac, I choose this by `git log -2 scripts/checkpa

Re: [Qemu-devel] [PATCH RFC] scripts/checkpatch.pl: Bug fix

2018-03-15 Thread Su Hang
for (i = 0; i < 0; ++i) +{ """ Instead of: """ ERROR: braces {} are necessary even for single statement blocks #4: FILE: test.c:4: +for (i = 0; i < 0; ++i) +{ +; +} """ > -----Original Messages- > From: &qu

[Qemu-devel] [PATCH RFC] scripts/checkpatch.pl: Bug fix

2018-03-15 Thread Su Hang
*if/ && $line !~ /\#\s*else/) { """ But I think, maybe it's ok, becasue all check has been done by up block. I'm not sure, please give me some advice. Signed-off-by: Su Hang --- scripts/checkpatch.pl | 15 +-- 1 file changed, 13 insertions(+),

Re: [Qemu-devel] [PATCH v11 00/13] Dirty bitmaps postcopy migration

2018-03-13 Thread Su Hang
Sincerely sorry for my negligence to cause this bug! I will fix it as quick as I can! Sorry again, I'm really ashamed about the mistake I have made. Su Hang > -Original Messages- > From: "Dr. David Alan Gilbert" > Sent Time: 2018-03-14 04:10:24 (Wednesday) &

Re: [Qemu-devel] BiteSizedTasks: API conversion

2018-03-12 Thread Su Hang
> -Original Messages- > From: "Peter Maydell" > Sent Time: 2018-03-12 19:40:22 (Monday) > To: "Su Hang" > Cc: "thomas huth" , "QEMU Developers" > > Subject: Re: [Qemu-devel] BiteSizedTasks: API conversion > >

[Qemu-devel] BiteSizedTasks: API conversion

2018-03-12 Thread Su Hang
space_write_rom`. By the way, sorry I don't find tool like `WikiBlame`, to help me find who add this task. So I can't CC others but you. Best, Su Hang

[Qemu-devel] [PATCH v4] scripts/checkpatch.pl: add check for `while` and `for`

2018-03-05 Thread Su Hang
27; But it doesn't do the same check for `for` and `while` statements. Using `(?:...)` instead of `(...)` in regex pattern catch. Because `(?:...)` is faster and avoids unwanted side-effect. Suggested-by: Stefan Hajnoczi Suggested-by: Eric Blake Suggested-by: Thomas Huth Signed-off-by: Su H

Re: [Qemu-devel] [PATCH v3] scripts/checkpatch.pl: add check for `while` and `for`

2018-03-05 Thread Su Hang
As too many emails overwhelmed my email box, I am very sorry for not seeing your reply until this morning. I will fix wrong using of git right now! "Stefan Hajnoczi" wrote: > On Wed, Feb 28, 2018 at 11:31:29AM +0800, Su Hang wrote: > > Adding check for `while` and `for

[Qemu-devel] [PATCH v3] scripts/checkpatch.pl: add check for `while` and `for`

2018-02-27 Thread Su Hang
27; But it doesn't do the same check for `for` and `while` statements. Using `(?:...)` instead of `(...)` in regex pattern catch. Because `(?:...)` is faster and avoids unwanted side-effect. Suggested-by: Stefan Hajnoczi Suggested-by: Eric Blake Suggested-by: Thomas Huth Signed-off-by: Su H

Re: [Qemu-devel] [PATCH v4 RFC 3/3] util/uri.c: wrap single statement blocks with braces {}

2018-02-25 Thread Su Hang
I can't be too happy to know my first patch get accepted! ^_^ I hope I can make more contributions to community! > -Original Messages- > From: "Thomas Huth" > Sent Time: 2018-02-26 14:49:46 (Monday) > To: "Su Hang" , boxa...@163.com > Cc:

[Qemu-devel] [PATCH v2 RFC] scripts/checkpatch.pl: add check for `while` and `for`

2018-02-25 Thread Su Hang
27; But it doesn't do the same check for `for` and `while` statements. Suggested-by: Eric Blake Suggested-by: Thomas Huth Signed-off-by: Su Hang --- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl inde

[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 in

2018-02-24 Thread Su Hang
Signed-off-by: Su Hang --- util/uri.c | 1468 ++-- 1 file changed, 735 insertions(+), 733 deletions(-) diff --git a/util/uri.c b/util/uri.c index 21b18281703a..cf09f41735a1 100644 --- a/util/uri.c +++ b/util/uri.c @@ -63,7 +63,6 @@ static

[Qemu-devel] [PATCH v4 RFC 3/3] util/uri.c: wrap single statement blocks with braces {}

2018-02-24 Thread Su Hang
; /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

[Qemu-devel] [PATCH v4 RFC 2/3] util/uri.c: remove brackets that wrap `return` statement's content.

2018-02-24 Thread Su Hang
only remove brackets that wrap `return` statements' content. use `perl -pi -e "s/return \((.*?)\);/return \1;/g" util/uri.c` to remove pattern like this: "return (1);" Signed-off-by: Su Hang --- util/uri.c | 160 ++--

[Qemu-devel] [PATCH v4 RFC 0/3] util/uri.c: Coding style format

2018-02-24 Thread Su Hang
Su Hang (3): util/uri.c: Coding style check, Only whitespace involved. util/uri.c: remove brackets () that wrap `return` statement's content. util/uri.c: wrap single statement blocks with braces {} util/uri.c | 1753 1

[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 in

2018-02-24 Thread Su Hang
Signed-off-by: Su Hang --- util/uri.c | 1468 ++-- 1 file changed, 735 insertions(+), 733 deletions(-) diff --git a/util/uri.c b/util/uri.c index 21b18281703a..cf09f41735a1 100644 --- a/util/uri.c +++ b/util/uri.c @@ -63,7 +63,6 @@ static

[Qemu-devel] [PATCH v4 RFC 3/3] util/uri.c: wrap single statement blocks with braces {}

2018-02-24 Thread Su Hang
; /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

[Qemu-devel] [PATCH v4 RFC 2/3] util/uri.c: remove brackets that wrap `return` statement's content.

2018-02-24 Thread Su Hang
only remove brackets that wrap `return` statements' content. use `perl -pi -e "s/return \((.*?)\);/return \1;/g" util/uri.c` to remove pattern like this: "return (1);" Signed-off-by: Su Hang --- util/uri.c | 160 ++--

[Qemu-devel] [PATCH v4 RFC 0/3] util/uri.c: Coding style format

2018-02-24 Thread Su Hang
*** BLURB HERE *** Su Hang (3): util/uri.c: Coding style check, Only whitespace involved. util/uri.c: remove brackets () that wrap `return` statement's content. util/uri.c: wrap single statement blocks with braces {} util/uri.c |

[Qemu-devel] [PATCH v2 RFC] scripts/checkpatch.pl:Add check for `while` and `for`

2018-02-24 Thread Su Hang
27; But it doesn't do the same check for `for` and `while` statement. Suggested-by: Eric Blake Suggested-by: Thomas Huth Signed-off-by: Su Hang --- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl inde

[Qemu-devel] [PATCH RFC] scripts/checkpatch.pl:Add check for `while` and `for`

2018-02-24 Thread Su Hang
27; But it doesn't do the same check for `for` and `while`. Suggested-by: Eric Blake Suggested-by: Thomas Huth Signed-off-by: Su Hang --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 1b4b812e28fa

[Qemu-devel] [PATCH v3 2/3] util/uri.c: only remove `return`'s brackets

2018-02-22 Thread Su Hang
only remove brackets that wrap `return` statements' content. use `perl -pi -e "s/return \((.*?)\);/return \1;/g" util/uri.c` to remove pattern like this: "return (1);" Signed-off-by: Su Hang --- util/uri.c | 160 ++--

[Qemu-devel] [PATCH v3 3/3] util/uri.c: add brackets to `if` statements

2018-02-22 Thread Su Hang
Add brackets that wrap `if`, `else`, `while` that hold single statements. In order to do this, I write a simple python regex script. Since then, all complaints rised by checkpatch.pl has been suppressed. Signed-off-by: Su Hang --- util/uri.c | 462

[Qemu-devel] [PATCH v3 1/3] util/uri.c: replace TAB with whitespace

2018-02-22 Thread Su Hang
Formating with clang-format. Change back few code by hand, to make sure only include whitespace change. Signed-off-by: Su Hang --- util/uri.c | 1456 ++-- 1 file changed, 729 insertions(+), 727 deletions(-) diff --git a/util/uri.c b/util

[Qemu-devel] [PATCH v2] util/uri.c formating

2018-02-20 Thread Su Hang
;& (bas->path[cur] != '/')) +cur++; ERROR: braces {} are necessary for all arms of this statement #1805: FILE: uri.c:1805: +if (bas->path[cur] == 0) [...] ''' Signed-off-by: Su Hang --- util/uri.c | 611 ++