linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] tracing: Use cpumask_available() to check if cpumask variable may be used
@ 2017-05-09 13:35 Steven Rostedt
  0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2017-05-09 13:35 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: LKML, Ingo Molnar, Andrew Morton, Matthias Kaehlcke


Linus,

This is a trivial patch that changes a check for a cpumask from a NULL
pointer to using cpumask_available(), which will do the check. This is
because cpumasks when not allocated are always set, and clang complains
about it.

I was just recently pinged about this patch. It required
cpumask_available() to be in your tree first.

Please pull the latest trace-v4.12-3 tree, which can be found at:


  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
trace-v4.12-3

Tag SHA1: 7eae248e169b333baaec1abe2878dcb7f1de3eeb
Head SHA1: 4dbbe2d8e95c351157f292ece067f985c30c7b53


Matthias Kaehlcke (1):
      tracing: Use cpumask_available() to check if cpumask variable may be used

----
 kernel/trace/trace.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---------------------------
commit 4dbbe2d8e95c351157f292ece067f985c30c7b53
Author: Matthias Kaehlcke <mka@chromium.org>
Date:   Fri Apr 21 16:41:10 2017 -0700

    tracing: Use cpumask_available() to check if cpumask variable may be used
    
    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)
    
    Link: http://lkml.kernel.org/r/20170421234110.117075-1-mka@chromium.org
    
    Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
    Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 4ad4420b33d6..c4536c449021 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -3311,13 +3311,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 */

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-05-09 13:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-09 13:35 [GIT PULL] tracing: Use cpumask_available() to check if cpumask variable may be used 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).