aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorzhouchuangao <zhouchuangao@vivo.com>2021-04-23 01:35:09 -0700
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2021-06-21 11:40:54 +0200
commita2cdc24e20573cf719f3171071368f4f7781d970 (patch)
tree694b2450e3075b0265bd649b6a4597a3118228a1
parentMIPS: OCTEON: octeon-usb: Use devm_platform_get_and_ioremap_resource() (diff)
downloadwireguard-linux-a2cdc24e20573cf719f3171071368f4f7781d970.tar.xz
wireguard-linux-a2cdc24e20573cf719f3171071368f4f7781d970.zip
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>
-rw-r--r--arch/mips/kvm/tlb.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/mips/kvm/tlb.c b/arch/mips/kvm/tlb.c
index 1088114e5482..a3b50d5e3b25 100644
--- a/arch/mips/kvm/tlb.c
+++ b/arch/mips/kvm/tlb.c
@@ -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));