From patchwork Mon Nov 28 12:03:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhang.songyi@zte.com.cn X-Patchwork-Id: 26725 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5622384wrr; Mon, 28 Nov 2022 04:24:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf6NMN+cJ3HLRojdoacyEylk4taKUDU6uskuPK8wv0A0lLOSZQaDd9g0ZGl5wKHjYMTZRt15 X-Received: by 2002:a17:907:9116:b0:78a:16ad:8250 with SMTP id p22-20020a170907911600b0078a16ad8250mr31631676ejq.747.1669638250556; Mon, 28 Nov 2022 04:24:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669638250; cv=none; d=google.com; s=arc-20160816; b=Zzbr1s09ThdXzjEaM4RHvc2tUAW8zJzMFsgBzeruy3l2C+G3wSSJMEhtCejcZ7VxAo HtA5IyyAi+00akTqorYDCPrBbjCRadT5G2V48onEyjGgLEZs48VQvwtvzMwolqUuarOP hkQmCPQX2lm9iQwByPOs/aGBGGPZFIRi+ZgE4+9/v+AV2ZNVtXxnslLMmOKhsbR1voJG LhwbHQFYnVY3jmpevAb2vjO/jkctwhz8VDl45tEEF3MfSCouqyqALpJOjnM6AO7eKCVp I8uqtlGkq2avdLI+sSZPG4l4ksBfhceffz/C0kxd0vUhw0qQ9HfXZZPd7gqMJf/reuex vi/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=+kIo+ErSLxTOPb8iZpCaXzo3iDRAdgLdKkPl/rcjY+0=; b=TTdazBp1y/PbFJR6ntkO38jm5gBsjB8wFIxEX7k59lFEPhr1yglAJ+U9HRZNh4yMT3 O41WRMSxl7tSX9W4WuyzNU9aCFB+jr4zL85NXK6UytgAQ6fdE3gcSW8VAKbmnRLhmUnK zr0foxvGvwymd2Cm9wkpSAnZQf73IyikmHxVdFVPd/X7ZhqNKBYxjRSiR0MkPb6OKSpL iLMFr3hfIIbwJjxDdQhzac4gnRoXpicN3XoJWJaMIpJsHWWeIIJ6oFUhDW1krEV9uoQW OMWLhIbROBsIDor4DnFd5rz8boBeVOtu9nxHItwDMqzR+p3Hg1NgeQmfHtGX+q3uj7up 4wOQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd34-20020a17090796a200b007833c7cf1dcsi12017425ejc.387.2022.11.28.04.23.44; Mon, 28 Nov 2022 04:24:10 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230352AbiK1MRi (ORCPT + 99 others); Mon, 28 Nov 2022 07:17:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230291AbiK1MRP (ORCPT ); Mon, 28 Nov 2022 07:17:15 -0500 Received: from mxct.zte.com.cn (mxct.zte.com.cn [58.251.27.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 661DF1D65D; Mon, 28 Nov 2022 04:08:23 -0800 (PST) Received: from mxde.zte.com.cn (unknown [10.35.20.121]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4NLPPd1lCrz1DxY; Mon, 28 Nov 2022 20:08:21 +0800 (CST) Received: from mxus.zte.com.cn (unknown [10.207.168.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mxde.zte.com.cn (FangMail) with ESMTPS id 4NLPPL6dmRz9vSnv; Mon, 28 Nov 2022 20:08:06 +0800 (CST) Received: from mxhk.zte.com.cn (unknown [192.168.250.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mxus.zte.com.cn (FangMail) with ESMTPS id 4NLPP52dXsz9tyD8; Mon, 28 Nov 2022 20:07:53 +0800 (CST) Received: from mxct.zte.com.cn (unknown [192.168.251.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4NLPLr3vXtz5BNS0; Mon, 28 Nov 2022 20:05:56 +0800 (CST) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4NLPJs1MyVz4y0vQ; Mon, 28 Nov 2022 20:04:13 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl2.zte.com.cn with SMTP id 2ASC3aJB077098; Mon, 28 Nov 2022 20:03:36 +0800 (+08) (envelope-from zhang.songyi@zte.com.cn) Received: from mapi (xaxapp02[null]) by mapi (Zmail) with MAPI id mid31; Mon, 28 Nov 2022 20:03:38 +0800 (CST) Date: Mon, 28 Nov 2022 20:03:38 +0800 (CST) X-Zmail-TransId: 2afa6384a39affffffffe970c9cc X-Mailer: Zmail v1.0 Message-ID: <202211282003389362484@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , , , , Subject: =?utf-8?q?=5BPATCH_linux-next=5D_KVM=3A_SVM=3A_remove_redundant_ret?= =?utf-8?q?_variable?= X-MAIL: mse-fl2.zte.com.cn 2ASC3aJB077098 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.251.14.novalocal with ID 6384A4B4.000 by FangMail milter! X-FangMail-Envelope: 1669637301/4NLPPd1lCrz1DxY/6384A4B4.000/10.35.20.121/[10.35.20.121]/mxde.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 6384A4B4.000/4NLPPd1lCrz1DxY X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750742598616616377?= X-GMAIL-MSGID: =?utf-8?q?1750742598616616377?= From: zhang songyi Return value from svm_nmi_blocked() directly instead of taking this in another redundant variable. Signed-off-by: zhang songyi --- arch/x86/kvm/svm/svm.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) -- 2.15.2 diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index ce362e88a567..416812f971f2 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -3572,7 +3572,6 @@ bool svm_nmi_blocked(struct kvm_vcpu *vcpu) { struct vcpu_svm *svm = to_svm(vcpu); struct vmcb *vmcb = svm->vmcb; - bool ret; if (!gif_set(svm)) return true; @@ -3580,10 +3579,8 @@ bool svm_nmi_blocked(struct kvm_vcpu *vcpu) if (is_guest_mode(vcpu) && nested_exit_on_nmi(svm)) return false; - ret = (vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK) || - (vcpu->arch.hflags & HF_NMI_MASK); - - return ret; + return (vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK) || + (vcpu->arch.hflags & HF_NMI_MASK); } static int svm_nmi_allowed(struct kvm_vcpu *vcpu, bool for_injection)