summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2016-07-04 17:10:04 +0200
committerSteven Rostedt <rostedt@goodmis.org>2016-07-05 17:22:40 +0200
commit67f20b084574def586ecba68508acd5d054ccc88 (patch)
treeef54744f591fec1a9a0a441956e28433bd2fefaa /kernel
parentftrace: Move toplevel init out of ftrace_init_tracefs() (diff)
downloadlinux-67f20b084574def586ecba68508acd5d054ccc88.tar.xz
linux-67f20b084574def586ecba68508acd5d054ccc88.zip
tracing: Using for_each_set_bit() to simplify trace_pid_write()
Using for_each_set_bit() to simplify the code. Link: http://lkml.kernel.org/r/1467645004-11169-1-git-send-email-weiyj_lk@163.com Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 5fd53a7847bc..dade4c9559cc 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -517,13 +517,9 @@ int trace_pid_write(struct trace_pid_list *filtered_pids,
if (filtered_pids) {
/* copy the current bits to the new max */
- pid = find_first_bit(filtered_pids->pids,
- filtered_pids->pid_max);
- while (pid < filtered_pids->pid_max) {
+ for_each_set_bit(pid, filtered_pids->pids,
+ filtered_pids->pid_max) {
set_bit(pid, pid_list->pids);
- pid = find_next_bit(filtered_pids->pids,
- filtered_pids->pid_max,
- pid + 1);
nr_pids++;
}
}