Skip to contentSkip to conversation

BUG_ON() Conversion in kernel/signal.c

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

lore
Share & tools
lore
#0 lore raw

PATCH 6/6 BUG_ON() Conversion in kernel/signal.c

hi,

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

kernel/timer.c renamed from kernel/timer.c.orig +2 -4
@@ -1255,8 +1255,7 @@ static void __devinit migrate_timers(int
 	spin_lock(&new_base->t_base.lock);
 	spin_lock(&old_base->t_base.lock);
 
-	if (old_base->t_base.running_timer)
-		BUG();
+	BUG_ON(old_base->t_base.running_timer);
 	for (i = 0; i < TVR_SIZE; i++)
 		migrate_timer_list(new_base, old_base->tv1.vec + i);
 	for (i = 0; i < TVN_SIZE; i++) {
@@ -1446,8 +1445,7 @@ register_time_interpolator(struct time_i
 	unsigned long flags;
 
 	/* Sanity check */
-	if (ti->frequency == 0 || ti->mask == 0)
-		BUG();
+	BUG_ON(ti->frequency == 0 || ti->mask == 0);
 
 	ti->nsec_per_cyc = ((u64)NSEC_PER_SEC << ti->shift) / ti->frequency;
 	spin_lock(&time_interpolator_lock);

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