From patchwork Mon Aug 7 09:42:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Like Xu X-Patchwork-Id: 131783 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp1345589vqr; Mon, 7 Aug 2023 03:13:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGLW1QY6lcXWPoziE5EMk9rc7xgnNDxbtXdjNEndOHw5GmSSwEnYEjO4R4KwL1Ky7l5Bykf X-Received: by 2002:a17:906:3050:b0:99b:f3f5:9752 with SMTP id d16-20020a170906305000b0099bf3f59752mr8238896ejd.14.1691403198133; Mon, 07 Aug 2023 03:13:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691403198; cv=none; d=google.com; s=arc-20160816; b=H9j+2xR7gpbUtTV8iR23VE6kj6A9bG8NZeM79L9/aflwQ4zdVQ8WwJ/CVoh5imN4ip RGzuS+fbIUoS0E6afTInNhfLaByoMOtahAt7QrVbRRYqcN5KCyuIbxZAwup6rQiGXod1 4hljvcxCwxbZ3UALqp/uQ/zDuAdxaYdOGOActogVF6jPdJ02kkpGEW9P9M2RQug8kEQg W1m/R7w/gAg9O2CCBAJyPtWwAfaCGii0s4u7NmxtZOngBfIZdzYO721LIfair14FSsCQ UQxwI4IXFOqbH1M6vz3E/DJB+OM4ikCAptIZUAsLHbAB1S57hZTypwpnY6MWadRplWaK pgYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=39EEzKezMc6xodopxuIo6ZRgeTbCfZRChxumxhtp/FM=; fh=wWLkqeJxZr09oc5dDjNtUOF7e3HluU3U6x4gmIxacKM=; b=sd5gTohQpkj51fab9nNhe5Q9jYWCqym3U4zzxM14kdwPzHq+cMtB94u40ddGX7xl7B 1/ZoWnSAPicvbd5bJvj2xZsediE3Vnhia7VDGOsEoOK2tIaqVYZzyM5x9AdsmvlDpyQ+ zIcHoN0XDpb1F97QLmFG1cwGc96moYx/ggliYmOiyvDFfPDWlCnMZoMAZT6X4zutICt4 4tpDdiyF0nRYZjXHTSiz/4W5Fz6QAB6EQtRlYuMZGq6YY1j9kvVhxVvQpnehXkYQMRlz cITgYdBMK50J39JwEswjrBHooIbl2gdz8Fz9Rfbs0iwCKq99LPY4X9PrALocojkdL97/ imRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=mxHMQyaS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i2-20020a170906444200b0099bc0f17468si5399105ejp.866.2023.08.07.03.12.54; Mon, 07 Aug 2023 03:13:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=mxHMQyaS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231667AbjHGJnT (ORCPT + 99 others); Mon, 7 Aug 2023 05:43:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231645AbjHGJnR (ORCPT ); Mon, 7 Aug 2023 05:43:17 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 754401701; Mon, 7 Aug 2023 02:43:15 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-564a0d2d35eso2052648a12.0; Mon, 07 Aug 2023 02:43:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691401395; x=1692006195; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=39EEzKezMc6xodopxuIo6ZRgeTbCfZRChxumxhtp/FM=; b=mxHMQyaSOiY/aS8yiBkShK4dgrs5QZh/U6y6Bn0Pq1T5awerX0miafCAX/nu3cExWk AtFEZ32D76TRkEy3VZLIl+g5W4xow6g+BLcCfu8HDUSPQfmbDBxlPE/oVRsdS90USkoU /sOtP7ExllQI1x8dSCTk8Uyz4R71+vMEX7G0tEfOZasR0pT69Yp2foaLY7tc9Co9/6Fr IhQrltu+Z7sGrT4SgtZNFfPFi503qsQqJ52hkaxfgK5bCN97ffU+z6jqNjwQwURUUto6 brSre94XpxeX7vaEcwjlT/qs5LWNUe7JzTs5ciFbpMMf+SABP3juqSEEAjNaFy2ZiSH0 N2Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691401395; x=1692006195; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=39EEzKezMc6xodopxuIo6ZRgeTbCfZRChxumxhtp/FM=; b=LEsgKMIEc59S1OhrIZ/nbC3Wa6F6tzImWRjCLTTuNiigy+sSD3ZWIWWB8QEtreK8Cb z4i1n8W1O3u1nEOH2DzgYtreEgLavi1iroNOc0hOfEBffsIxBPwfgHX6UkPksN3qWJgL 5d7wrhrtZ3unGDqmEcZxA1ZufvTEfD69UrO+JElGm5wOKzpfuhy9Uxdkk5CqSIxy7CKo bGNk9Jah8UvkJOMNgB3hTWgu66hHeg2mHdoBcDUQVSy5/Ksmyxu4bUHarnAQYkN5a615 od+0p+QKX5E5m+8Veh3lRtCa/wd+Sj9bq3OEH0FHR5QHnaPbklWMAk239VNMnJVoKbGt fDaw== X-Gm-Message-State: AOJu0YysavM48EeptqKvmkKAzlhUH6Dmi/rYYM4gVVx0KsVEtNd5m8I7 NfM79CM09Px1U0AF71RpB3DDBKcNPLs4IKxB X-Received: by 2002:a05:6a20:428f:b0:140:6979:2952 with SMTP id o15-20020a056a20428f00b0014069792952mr5111915pzj.47.1691401394599; Mon, 07 Aug 2023 02:43:14 -0700 (PDT) Received: from localhost.localdomain ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id q8-20020a17090311c800b001bc675068e2sm2572378plh.111.2023.08.07.02.43.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Aug 2023 02:43:14 -0700 (PDT) From: Like Xu X-Google-Original-From: Like Xu To: Sean Christopherson Cc: Paolo Bonzini , Vitaly Kuznetsov , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] KVM: x86: Remove break statements that will never be executed Date: Mon, 7 Aug 2023 17:42:43 +0800 Message-ID: <20230807094243.32516-1-likexu@tencent.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773564799779081344 X-GMAIL-MSGID: 1773564799779081344 From: Like Xu Fix compiler warnings when compiling KVM with [-Wunreachable-code-break]. No functional change intended. Cc: Vitaly Kuznetsov Signed-off-by: Like Xu --- arch/x86/kvm/emulate.c | 2 -- arch/x86/kvm/hyperv.c | 1 - arch/x86/kvm/x86.c | 1 - 3 files changed, 4 deletions(-) base-commit: 240f736891887939571854bd6d734b6c9291f22e diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 936a397a08cd..2673cd5c46cb 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -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; diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c index b28fd020066f..7c2dac6824e2 100644 --- a/arch/x86/kvm/hyperv.c +++ b/arch/x86/kvm/hyperv.c @@ -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 & diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 34945c7dba38..f3f8d27acc96 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4647,7 +4647,6 @@ static int kvm_x86_dev_get_attr(struct kvm_device_attr *attr) return 0; default: return -ENXIO; - break; } }