riscv/mm: Use BUG_ON instead of if condition followed by BUG.
BUG_ON() uses unlikely in if(), which can be optimized at compile time. Signed-off-by: zhouchuangao <zhouchuangao@vivo.com> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
This commit is contained in:
parent
b1ebaa0e13
commit
e75e6bf47a
@ -232,8 +232,8 @@ static phys_addr_t alloc_pte_late(uintptr_t va)
|
||||
unsigned long vaddr;
|
||||
|
||||
vaddr = __get_free_page(GFP_KERNEL);
|
||||
if (!vaddr || !pgtable_pte_page_ctor(virt_to_page(vaddr)))
|
||||
BUG();
|
||||
BUG_ON(!vaddr || !pgtable_pte_page_ctor(virt_to_page(vaddr)));
|
||||
|
||||
return __pa(vaddr);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user