Commit e75e6bf4 authored by zhouchuangao's avatar zhouchuangao Committed by Palmer Dabbelt

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: default avatarzhouchuangao <zhouchuangao@vivo.com>
Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
parent b1ebaa0e
...@@ -232,8 +232,8 @@ static phys_addr_t alloc_pte_late(uintptr_t va) ...@@ -232,8 +232,8 @@ static phys_addr_t alloc_pte_late(uintptr_t va)
unsigned long vaddr; unsigned long vaddr;
vaddr = __get_free_page(GFP_KERNEL); vaddr = __get_free_page(GFP_KERNEL);
if (!vaddr || !pgtable_pte_page_ctor(virt_to_page(vaddr))) BUG_ON(!vaddr || !pgtable_pte_page_ctor(virt_to_page(vaddr)));
BUG();
return __pa(vaddr); return __pa(vaddr);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment