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 <[email protected]>
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/[email protected]
    
    Signed-off-by: Matthias Kaehlcke <[email protected]>
    Signed-off-by: Steven Rostedt (VMware) <[email protected]>

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 */

Reply via email to