All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf tools: replace assignment with comparison on assert check
@ 2016-04-23 13:45 Colin King
  2016-04-25 21:33 ` Masami Hiramatsu
  2016-04-27 15:32 ` [tip:perf/core] perf tests: Replace " tip-bot for Colin Ian King
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2016-04-23 13:45 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Alexander Shishkin, Jiri Olsa
  Cc: linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The current assert check is checking an assignment, which will always
be true.  Instead, the assert should be checking if scale is equal
to 0.122

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 tools/perf/tests/event_update.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/event_update.c b/tools/perf/tests/event_update.c
index 012eab5..63ecf21 100644
--- a/tools/perf/tests/event_update.c
+++ b/tools/perf/tests/event_update.c
@@ -30,7 +30,7 @@ static int process_event_scale(struct perf_tool *tool __maybe_unused,
 
 	TEST_ASSERT_VAL("wrong id", ev->id == 123);
 	TEST_ASSERT_VAL("wrong id", ev->type == PERF_EVENT_UPDATE__SCALE);
-	TEST_ASSERT_VAL("wrong scale", ev_data->scale = 0.123);
+	TEST_ASSERT_VAL("wrong scale", ev_data->scale == 0.123);
 	return 0;
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf tools: replace assignment with comparison on assert check
  2016-04-23 13:45 [PATCH] perf tools: replace assignment with comparison on assert check Colin King
@ 2016-04-25 21:33 ` Masami Hiramatsu
  2016-04-27 15:32 ` [tip:perf/core] perf tests: Replace " tip-bot for Colin Ian King
  1 sibling, 0 replies; 3+ messages in thread
From: Masami Hiramatsu @ 2016-04-25 21:33 UTC (permalink / raw)
  To: Colin King
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Alexander Shishkin, Jiri Olsa, linux-kernel

On Sat, 23 Apr 2016 14:45:54 +0100
Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> The current assert check is checking an assignment, which will always
> be true.  Instead, the assert should be checking if scale is equal
> to 0.122
> 

Looks good to me.

Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>

> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  tools/perf/tests/event_update.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/tests/event_update.c b/tools/perf/tests/event_update.c
> index 012eab5..63ecf21 100644
> --- a/tools/perf/tests/event_update.c
> +++ b/tools/perf/tests/event_update.c
> @@ -30,7 +30,7 @@ static int process_event_scale(struct perf_tool *tool __maybe_unused,
>  
>  	TEST_ASSERT_VAL("wrong id", ev->id == 123);
>  	TEST_ASSERT_VAL("wrong id", ev->type == PERF_EVENT_UPDATE__SCALE);
> -	TEST_ASSERT_VAL("wrong scale", ev_data->scale = 0.123);
> +	TEST_ASSERT_VAL("wrong scale", ev_data->scale == 0.123);
>  	return 0;
>  }
>  
> -- 
> 2.7.4
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:perf/core] perf tests: Replace assignment with comparison on assert check
  2016-04-23 13:45 [PATCH] perf tools: replace assignment with comparison on assert check Colin King
  2016-04-25 21:33 ` Masami Hiramatsu
@ 2016-04-27 15:32 ` tip-bot for Colin Ian King
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Colin Ian King @ 2016-04-27 15:32 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: alexander.shishkin, mingo, hpa, tglx, linux-kernel, jolsa,
	peterz, colin.king, acme, mhiramat

Commit-ID:  8daef508b0a144970e5cbc587525c351663fec63
Gitweb:     http://git.kernel.org/tip/8daef508b0a144970e5cbc587525c351663fec63
Author:     Colin Ian King <colin.king@canonical.com>
AuthorDate: Sat, 23 Apr 2016 14:45:54 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 25 Apr 2016 20:24:26 -0300

perf tests: Replace assignment with comparison on assert check

The current assert check is checking an assignment, which will always be
true.  Instead, the assert should be checking if scale is equal to 0.122

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1461419154-16918-1-git-send-email-colin.king@canonical.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/tests/event_update.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/event_update.c b/tools/perf/tests/event_update.c
index 012eab5..63ecf21 100644
--- a/tools/perf/tests/event_update.c
+++ b/tools/perf/tests/event_update.c
@@ -30,7 +30,7 @@ static int process_event_scale(struct perf_tool *tool __maybe_unused,
 
 	TEST_ASSERT_VAL("wrong id", ev->id == 123);
 	TEST_ASSERT_VAL("wrong id", ev->type == PERF_EVENT_UPDATE__SCALE);
-	TEST_ASSERT_VAL("wrong scale", ev_data->scale = 0.123);
+	TEST_ASSERT_VAL("wrong scale", ev_data->scale == 0.123);
 	return 0;
 }
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-27 15:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-23 13:45 [PATCH] perf tools: replace assignment with comparison on assert check Colin King
2016-04-25 21:33 ` Masami Hiramatsu
2016-04-27 15:32 ` [tip:perf/core] perf tests: Replace " tip-bot for Colin Ian King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.