lkml.org 
[lkml]   [2013]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] tracing: remove the found node directly before break the search-loop
Just a clean-up, but it gives us better readability.

Sign-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 7d85429..a44f501 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -1827,13 +1827,13 @@ static void trace_module_remove_events(struct module *mod)

/* Now free the file_operations */
list_for_each_entry(file_ops, &ftrace_module_file_list, list) {
- if (file_ops->mod == mod)
+ if (file_ops->mod == mod) {
+ list_del(&file_ops->list);
+ kfree(file_ops);
break;
+ }
}
- if (&file_ops->list != &ftrace_module_file_list) {
- list_del(&file_ops->list);
- kfree(file_ops);
- }
+
up_write(&trace_event_sem);

/*

\
 
 \ /
  Last update: 2013-07-25 06:41    [W:0.027 / U:5.432 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site