Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1436202 > unrolled thread

[PATCH -next] tracing: Using for_each_set_bit to simplify the code

Started byweiyj_lk@163.com
First post2016-07-04 17:20 +0200
Last post2016-07-05 17:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH -next] tracing: Using for_each_set_bit to simplify the code weiyj_lk@163.com - 2016-07-04 17:20 +0200
    Re: [PATCH -next] tracing: Using for_each_set_bit to simplify the  code Steven Rostedt <rostedt@goodmis.org> - 2016-07-05 17:30 +0200

#1436202 — [PATCH -next] tracing: Using for_each_set_bit to simplify the code

Fromweiyj_lk@163.com
Date2016-07-04 17:20 +0200
Subject[PATCH -next] tracing: Using for_each_set_bit to simplify the code
Message-ID<rRdPc-7gk-23@gated-at.bofh.it>
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Using for_each_set_bit() to simplify the code.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 kernel/trace/trace.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 3d9f31b..48fce20 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++;
 		}
 	}

[toc] | [next] | [standalone]


#1437126 — Re: [PATCH -next] tracing: Using for_each_set_bit to simplify the code

FromSteven Rostedt <rostedt@goodmis.org>
Date2016-07-05 17:30 +0200
SubjectRe: [PATCH -next] tracing: Using for_each_set_bit to simplify the code
Message-ID<rRAsp-4Ci-23@gated-at.bofh.it>
In reply to#1436202
On Mon,  4 Jul 2016 15:10:04 +0000
weiyj_lk@163.com wrote:

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Using for_each_set_bit() to simplify the code.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---

Thanks, Applied to my queue.

-- Steve

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web