summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authoryuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>2018-04-08 14:36:31 +0300
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2018-07-04 01:23:33 +0300
commitf26808ba7227a921e0e8549c7d3c52332b920085 (patch)
tree699f09c2967d89edbcdc522102019240a90c3c0d /kernel
parentf90658725ba7ebb031054866aff4cda0d099a3b1 (diff)
downloadlinux-f26808ba7227a921e0e8549c7d3c52332b920085.tar.xz
tracing: Optimize trace_buffer_iter() logic
Simplify and optimize the logic in trace_buffer_iter() to use a conditional operation instead of an if conditional. Link: http://lkml.kernel.org/r/20180408113631.3947-1-cugyly@163.com Signed-off-by: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 630c5a24b2b2..f8f86231ad90 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -583,9 +583,7 @@ static __always_inline void trace_clear_recursion(int bit)
static inline struct ring_buffer_iter *
trace_buffer_iter(struct trace_iterator *iter, int cpu)
{
- if (iter->buffer_iter && iter->buffer_iter[cpu])
- return iter->buffer_iter[cpu];
- return NULL;
+ return iter->buffer_iter ? iter->buffer_iter[cpu] : NULL;
}
int tracer_init(struct tracer *t, struct trace_array *tr);