linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tracing: Use cpumask_available() to check if cpumask variable may be used
@ 2017-04-21 23:41 Matthias Kaehlcke
  2017-05-08 22:36 ` Matthias Kaehlcke
  0 siblings, 1 reply; 3+ messages in thread
From: Matthias Kaehlcke @ 2017-04-21 23:41 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar
  Cc: linux-kernel, Grant Grundler, Greg Hackmann, Michael Davidson,
	Matthias Kaehlcke

This fixes the following clang warning:

kernel/trace/trace.c:3231:12: warning: address of array 'iter->started'
  will always evaluate to 'true' [-Wpointer-bool-conversion]
        if (iter->started)

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
Dependencies:
- "cpumask: Add helper cpumask_available()"
  - git.kernel.org tip master f7e30f01a9e2
  - https://patchwork.kernel.org/patch/9678159/

 kernel/trace/trace.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index d484452ae648..95eeefc08605 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -3222,13 +3222,14 @@ static void test_cpu_buff_start(struct trace_iterator *iter)
 	if (!(iter->iter_flags & TRACE_FILE_ANNOTATE))
 		return;
 
-	if (iter->started && cpumask_test_cpu(iter->cpu, iter->started))
+	if (cpumask_available(iter->started) &&
+	    cpumask_test_cpu(iter->cpu, iter->started))
 		return;
 
 	if (per_cpu_ptr(iter->trace_buffer->data, iter->cpu)->skipped_entries)
 		return;
 
-	if (iter->started)
+	if (cpumask_available(iter->started))
 		cpumask_set_cpu(iter->cpu, iter->started);
 
 	/* Don't print started cpu buffer for the first entry of the trace */
-- 
2.12.2.816.g2cccc81164-goog

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

end of thread, other threads:[~2017-05-09  1:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-21 23:41 [PATCH] tracing: Use cpumask_available() to check if cpumask variable may be used Matthias Kaehlcke
2017-05-08 22:36 ` Matthias Kaehlcke
2017-05-09  1:24   ` Steven Rostedt

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).