Skip to contentSkip to conversation

KVM: x86: Remove break statements that will never be executed

PATCH Applied Like Xu 2 participants 2 messages Aug 7, 2023 – Aug 18, 2023

Subsystems (4)
lore
Share & tools
lore

Like Xu

author
#0 lore raw

PATCH 1/1 KVM: x86: Remove break statements that will never be executed

From: Like Xu <[email protected]>

Fix compiler warnings when compiling KVM with [-Wunreachable-code-break]. No functional change intended.

Cc Vitaly Kuznetsov <[email protected]>
---
 arch/x86/kvm/emulate.c | 2 --
 arch/x86/kvm/hyperv.c  | 1 -
 arch/x86/kvm/x86.c     | 1 -
 3 files changed, 4 deletions(-)
arch/x86/kvm/emulate.c +0 -2
index 936a397a08cd..2673cd5c46cb 100644
@@ -1799,13 +1799,11 @@ static int writeback(struct x86_emulate_ctxt *ctxt, struct operand *op)
 					       op->addr.mem,
 					       &op->val,
 					       op->bytes);
-		break;
 	case OP_MEM_STR:
 		return segmented_write(ctxt,
 				       op->addr.mem,
 				       op->data,
 				       op->bytes * op->count);
-		break;
 	case OP_XMM:
 		kvm_write_sse_reg(op->addr.xmm, &op->vec_val);
 		break;
arch/x86/kvm/hyperv.c +0 -1
index b28fd020066f..7c2dac6824e2 100644
@@ -1293,7 +1293,6 @@ static bool hv_check_msr_access(struct kvm_vcpu_hv *hv_vcpu, u32 msr)
 	case HV_X64_MSR_VP_ASSIST_PAGE:
 		return hv_vcpu->cpuid_cache.features_eax &
 			HV_MSR_APIC_ACCESS_AVAILABLE;
-		break;
 	case HV_X64_MSR_TSC_FREQUENCY:
 	case HV_X64_MSR_APIC_FREQUENCY:
 		return hv_vcpu->cpuid_cache.features_eax &
arch/x86/kvm/x86.c +0 -1
index 34945c7dba38..f3f8d27acc96 100644
@@ -4647,7 +4647,6 @@ static int kvm_x86_dev_get_attr(struct kvm_device_attr *attr)
 		return 0;
 	default:
 		return -ENXIO;
-		break;
 	}
 }
 

base-commit: 240f736891887939571854bd6d734b6c9291f22e

Signature · 1 line
2.41.0