Skip to contentSkip to conversation

BUG_ON() Conversion in kernel/ptrace.c

PATCH New Eric Sesterhenn / snakebyte 1 participant 1 message Jan 30, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/6 BUG_ON() Conversion in kernel/ptrace.c

hi,

this changes if() BUG(); constructs to BUG_ON() which is cleaner, contains unlikely() and can better optimized away.

kernel/ptrace.c renamed from kernel/ptrace.c.orig +2 -4
@@ -30,8 +30,7 @@
  */
 void __ptrace_link(task_t *child, task_t *new_parent)
 {
-	if (!list_empty(&child->ptrace_list))
-		BUG();
+	BUG_ON(!list_empty(&child->ptrace_list));
 	if (child->parent == new_parent)
 		return;
 	list_add(&child->ptrace_list, &child->parent->ptrace_children);
@@ -72,8 +71,7 @@ void ptrace_untrace(task_t *child)
  */
 void __ptrace_unlink(task_t *child)
 {
-	if (!child->ptrace)
-		BUG();
+	BUG_ON(!child->ptrace);
 	child->ptrace = 0;
 	if (!list_empty(&child->ptrace_list)) {
 		list_del_init(&child->ptrace_list);

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors