Skip to contentSkip to conversation

tracing: remove the found node directly before break the search-loop

PATCH New Lai Jiangshan 1 participant 1 message Jul 25, 2013 Tracing

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tracing: remove the found node directly before break the search-loop

Just a clean-up, but it gives us better readability.

---

kernel/trace/trace_events.c +5 -5
index 7d85429..a44f501 100644
@@ -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);
 
 	/*