OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b1ebaa0
)
riscv/mm: Use BUG_ON instead of if condition followed by BUG.
author
zhouchuangao
<zhouchuangao@vivo.com>
Tue, 30 Mar 2021 13:56:26 +0000
(06:56 -0700)
committer
Palmer Dabbelt
<palmerdabbelt@google.com>
Mon, 26 Apr 2021 15:25:18 +0000
(08:25 -0700)
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>
arch/riscv/mm/init.c
patch
|
blob
|
history
diff --git
a/arch/riscv/mm/init.c
b/arch/riscv/mm/init.c
index
9914ca0
..
a2f4c14
100644
(file)
--- a/
arch/riscv/mm/init.c
+++ b/
arch/riscv/mm/init.c
@@
-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);
}