Skip to content

Commit 8d8f3cb

Browse files
SesterhennEricAdrianBunk
authored andcommitted
BUG_ON cleanups in arch/i386
This changes a couple of if() BUG(); constructs to BUG_ON(); so it can be safely optimized away. Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
1 parent 644c12d commit 8d8f3cb

4 files changed

Lines changed: 4 additions & 8 deletions

File tree

‎arch/i386/kernel/cpu/common.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,8 +669,7 @@ void __cpuinit cpu_init(void)
669669
*/
670670
atomic_inc(&init_mm.mm_count);
671671
current->active_mm = &init_mm;
672-
if (current->mm)
673-
BUG();
672+
BUG_ON(current->mm);
674673
enter_lazy_tlb(&init_mm, current);
675674

676675
load_esp0(t, thread);

‎arch/i386/kernel/efi.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,7 @@ void __init efi_enter_virtual_mode(void)
498498
check_range_for_systab(md);
499499
}
500500

501-
if (!efi.systab)
502-
BUG();
501+
BUG_ON(!efi.systab);
503502

504503
status = phys_efi_set_virtual_address_map(
505504
memmap.desc_size * memmap.nr_map,

‎arch/i386/mm/discontig.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,7 @@ static void __init find_max_pfn_node(int nid)
153153
*/
154154
if (node_start_pfn[nid] > max_pfn)
155155
node_start_pfn[nid] = max_pfn;
156-
if (node_start_pfn[nid] > node_end_pfn[nid])
157-
BUG();
156+
BUG_ON(node_start_pfn[nid] > node_end_pfn[nid]);
158157
}
159158

160159
/*

‎arch/i386/mm/init.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,8 +569,7 @@ void __init mem_init(void)
569569
int bad_ppro;
570570

571571
#ifdef CONFIG_FLATMEM
572-
if (!mem_map)
573-
BUG();
572+
BUG_ON(!mem_map);
574573
#endif
575574

576575
bad_ppro = ppro_with_ram_bug();

0 commit comments

Comments
 (0)