Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: zhouchuangao <zhouchuangao@vivo.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

authored by

zhouchuangao and committed by
Thomas Bogendoerfer
a2cdc24e f9cd46a4

+1 -2
+1 -2
arch/mips/kvm/tlb.c
··· 58 58 tlb_probe_hazard(); 59 59 idx = read_c0_index(); 60 60 61 - if (idx >= current_cpu_data.tlbsize) 62 - BUG(); 61 + BUG_ON(idx >= current_cpu_data.tlbsize); 63 62 64 63 if (idx >= 0) { 65 64 write_c0_entryhi(UNIQUE_ENTRYHI(idx));