[Qemu-devel] [PATCH] trace: simple style changes

Larry Dewey posted 1 patch 5 years, 4 months ago
Test asan passed
Test checkpatch passed
Test docker-quick@centos7 passed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20181127190849.10558-1-ldewey@suse.com
trace/simple.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[Qemu-devel] [PATCH] trace: simple style changes
Posted by Larry Dewey 5 years, 4 months ago
This changes two lines in simple.c that end with a comma, and replaces them
with a semi-colon.

Signed-off-by: Larry Dewey <ldewey@suse.com>
---
 trace/simple.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/trace/simple.c b/trace/simple.c
index 701dec639c..ac904eca91 100644
--- a/trace/simple.c
+++ b/trace/simple.c
@@ -169,9 +169,9 @@ static gpointer writeout_thread(gpointer opaque)
         wait_for_trace_records_available();
 
         if (g_atomic_int_get(&dropped_events)) {
-            dropped.rec.event = DROPPED_EVENT_ID,
+            dropped.rec.event = DROPPED_EVENT_ID;
             dropped.rec.timestamp_ns = get_clock();
-            dropped.rec.length = sizeof(TraceRecord) + sizeof(uint64_t),
+            dropped.rec.length = sizeof(TraceRecord) + sizeof(uint64_t);
             dropped.rec.pid = trace_pid;
             do {
                 dropped_count = g_atomic_int_get(&dropped_events);
-- 
2.19.1


Re: [Qemu-devel] [PATCH] trace: simple style changes
Posted by Stefan Hajnoczi 5 years, 4 months ago
On Tue, Nov 27, 2018 at 12:08:49PM -0700, Larry Dewey wrote:
> This changes two lines in simple.c that end with a comma, and replaces them
> with a semi-colon.
> 
> Signed-off-by: Larry Dewey <ldewey@suse.com>
> ---
>  trace/simple.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Thanks, applied to my tracing-next tree:
https://github.com/stefanha/qemu/commits/tracing-next

Stefan
Re: [Qemu-devel] [PATCH] trace: simple style changes
Posted by John Snow 5 years, 4 months ago

On 11/27/18 2:08 PM, Larry Dewey wrote:
> This changes two lines in simple.c that end with a comma, and replaces them
> with a semi-colon.
> 
> Signed-off-by: Larry Dewey <ldewey@suse.com>
> ---
>  trace/simple.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/trace/simple.c b/trace/simple.c
> index 701dec639c..ac904eca91 100644
> --- a/trace/simple.c
> +++ b/trace/simple.c
> @@ -169,9 +169,9 @@ static gpointer writeout_thread(gpointer opaque)
>          wait_for_trace_records_available();
>  
>          if (g_atomic_int_get(&dropped_events)) {
> -            dropped.rec.event = DROPPED_EVENT_ID,
> +            dropped.rec.event = DROPPED_EVENT_ID;
>              dropped.rec.timestamp_ns = get_clock();
> -            dropped.rec.length = sizeof(TraceRecord) + sizeof(uint64_t),
> +            dropped.rec.length = sizeof(TraceRecord) + sizeof(uint64_t);
>              dropped.rec.pid = trace_pid;
>              do {
>                  dropped_count = g_atomic_int_get(&dropped_events);
> 

I can't see any reason for why sequence points were used, other than in
62bab73213ba885426a781eb2741670b9f3cae36 getting mixed up between

if (cond) { ...; ... } and an earlier var = (type) { ..., ... }.

Reviewed-by: John Snow <jsnow@redhat.com>