Skip to contentSkip to conversation

BUG_ON() Conversion in kernel/printk.c

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

lore
Share & tools
lore
#0 lore raw

PATCH 3/6 BUG_ON() Conversion in kernel/printk.c

hi,

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

kernel/printk.c renamed from kernel/printk.c.orig +2 -4
@@ -398,8 +398,7 @@ static void call_console_drivers(unsigne
 	unsigned long cur_index, start_print;
 	static int msg_level = -1;
 
-	if (((long)(start - end)) > 0)
-		BUG();
+	BUG_ON(((long)(start - end)) > 0);
 
 	cur_index = start;
 	start_print = start;
@@ -708,8 +707,7 @@ int __init add_preferred_console(char *n
  */
 void acquire_console_sem(void)
 {
-	if (in_interrupt())
-		BUG();
+	BUG_ON(in_interrupt());
 	down(&console_sem);
 	console_locked = 1;
 	console_may_schedule = 1;

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