aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_workqueue.c
diff options
context:
space:
mode:
authorZhaolei <zhaolei@cn.fujitsu.com>2009-04-20 02:58:26 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2009-06-01 19:13:05 -0400
commit1fdfca9c577aac96a559c1ea68f5c9156f17d636 (patch)
treefbbeeba504037440e42cce056781d56ecebfc4b1 /kernel/trace/trace_workqueue.c
parentfb39125fd79a25c5002f3b45cf4c80e3fa6b961b (diff)
trace_workqueue: use list_for_each_entry() instead of list_for_each_entry_safe()
No need to use list_for_each_entry_safe() in iteration without deleting any node, we can use list_for_each_entry() instead. [ Impact: cleanup ] Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Tom Zanussi <tzanussi@gmail.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'kernel/trace/trace_workqueue.c')
-rw-r--r--kernel/trace/trace_workqueue.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/kernel/trace/trace_workqueue.c b/kernel/trace/trace_workqueue.c
index cfe56d31d85b..128b64b93f14 100644
--- a/kernel/trace/trace_workqueue.c
+++ b/kernel/trace/trace_workqueue.c
@@ -47,12 +47,11 @@ probe_workqueue_insertion(struct task_struct *wq_thread,
47 struct work_struct *work) 47 struct work_struct *work)
48{ 48{
49 int cpu = cpumask_first(&wq_thread->cpus_allowed); 49 int cpu = cpumask_first(&wq_thread->cpus_allowed);
50 struct cpu_workqueue_stats *node, *next; 50 struct cpu_workqueue_stats *node;
51 unsigned long flags; 51 unsigned long flags;
52 52
53 spin_lock_irqsave(&workqueue_cpu_stat(cpu)->lock, flags); 53 spin_lock_irqsave(&workqueue_cpu_stat(cpu)->lock, flags);
54 list_for_each_entry_safe(node, next, &workqueue_cpu_stat(cpu)->list, 54 list_for_each_entry(node, &workqueue_cpu_stat(cpu)->list, list) {
55 list) {
56 if (node->pid == wq_thread->pid) { 55 if (node->pid == wq_thread->pid) {
57 atomic_inc(&node->inserted); 56 atomic_inc(&node->inserted);
58 goto found; 57 goto found;
@@ -69,12 +68,11 @@ probe_workqueue_execution(struct task_struct *wq_thread,
69 struct work_struct *work) 68 struct work_struct *work)
70{ 69{
71 int cpu = cpumask_first(&wq_thread->cpus_allowed); 70 int cpu = cpumask_first(&wq_thread->cpus_allowed);
72 struct cpu_workqueue_stats *node, *next; 71 struct cpu_workqueue_stats *node;
73 unsigned long flags; 72 unsigned long flags;
74 73
75 spin_lock_irqsave(&workqueue_cpu_stat(cpu)->lock, flags); 74 spin_lock_irqsave(&workqueue_cpu_stat(cpu)->lock, flags);
76 list_for_each_entry_safe(node, next, &workqueue_cpu_stat(cpu)->list, 75 list_for_each_entry(node, &workqueue_cpu_stat(cpu)->list, list) {
77 list) {
78 if (node->pid == wq_thread->pid) { 76 if (node->pid == wq_thread->pid) {
79 node->executed++; 77 node->executed++;
80 goto found; 78 goto found;