Skip to content
Snippets Groups Projects
Commit a2cdc24e authored by zhouchuangao's avatar zhouchuangao Committed by Thomas Bogendoerfer
Browse files

mips/kvm: Use BUG_ON instead of if condition followed by BUG


BUG_ON uses unlikely in if(), it can be optimized at compile time.

Usually, the condition in if() is not satisfied. In my opinion,
this can improve the efficiency of the multi-stage pipeline.

Signed-off-by: default avatarzhouchuangao <zhouchuangao@vivo.com>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
parent f9cd46a4
No related branches found
No related tags found
No related merge requests found
......@@ -58,8 +58,7 @@ static int _kvm_mips_host_tlb_inv(unsigned long entryhi)
tlb_probe_hazard();
idx = read_c0_index();
if (idx >= current_cpu_data.tlbsize)
BUG();
BUG_ON(idx >= current_cpu_data.tlbsize);
if (idx >= 0) {
write_c0_entryhi(UNIQUE_ENTRYHI(idx));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment