[PATCH] tracing: Use cpumask_available() to check if cpumask variable may be used
From: Matthias Kaehlcke
Date: Fri Apr 21 2017 - 19:42:51 EST
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@xxxxxxxxxxxx>
---
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