瀏覽代碼

BUG_ON() Conversion in kernel/printk.c

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

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Eric Sesterhenn 19 年之前
父節點
當前提交
8abd8e298e
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. 2 4
      kernel/printk.c

+ 2 - 4
kernel/printk.c

@@ -360,8 +360,7 @@ static void call_console_drivers(unsigned long start, unsigned long end)
 	unsigned long cur_index, start_print;
 	unsigned long cur_index, start_print;
 	static int msg_level = -1;
 	static int msg_level = -1;
 
 
-	if (((long)(start - end)) > 0)
-		BUG();
+	BUG_ON(((long)(start - end)) > 0);
 
 
 	cur_index = start;
 	cur_index = start;
 	start_print = start;
 	start_print = start;
@@ -708,8 +707,7 @@ int __init add_preferred_console(char *name, int idx, char *options)
  */
  */
 void acquire_console_sem(void)
 void acquire_console_sem(void)
 {
 {
-	if (in_interrupt())
-		BUG();
+	BUG_ON(in_interrupt());
 	down(&console_sem);
 	down(&console_sem);
 	console_locked = 1;
 	console_locked = 1;
 	console_may_schedule = 1;
 	console_may_schedule = 1;