Skip to content

Commit

Permalink
BUG_ON() Conversion in kernel/printk.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Sesterhenn authored and Adrian Bunk committed Mar 31, 2006
1 parent 9bc98fc commit 8abd8e2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions kernel/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,7 @@ static void call_console_drivers(unsigned long start, unsigned long end)
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;
Expand Down Expand Up @@ -708,8 +707,7 @@ int __init add_preferred_console(char *name, int idx, char *options)
*/
void acquire_console_sem(void)
{
if (in_interrupt())
BUG();
BUG_ON(in_interrupt());
down(&console_sem);
console_locked = 1;
console_may_schedule = 1;
Expand Down

0 comments on commit 8abd8e2

Please sign in to comment.