From nobody Sun Apr 19 10:42:20 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B20F8C43334 for ; Wed, 6 Jul 2022 09:04:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231812AbiGFJEG (ORCPT ); Wed, 6 Jul 2022 05:04:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230115AbiGFJEE (ORCPT ); Wed, 6 Jul 2022 05:04:04 -0400 Received: from unicom146.biz-email.net (unicom146.biz-email.net [210.51.26.146]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BD6FE24; Wed, 6 Jul 2022 02:04:02 -0700 (PDT) Received: from ([60.208.111.195]) by unicom146.biz-email.net ((D)) with ASMTP (SSL) id BIK00057; Wed, 06 Jul 2022 17:03:57 +0800 Received: from localhost.localdomain (10.200.104.82) by jtjnmail201611.home.langchao.com (10.100.2.11) with Microsoft SMTP Server id 15.1.2507.9; Wed, 6 Jul 2022 17:03:58 +0800 From: Deming Wang To: , , , , , , CC: , , , Deming Wang Subject: [PATCH] KVM: LAPIC: Separate the variable declaration and code logic Date: Sun, 3 Jul 2022 00:54:10 -0400 Message-ID: <20220703045410.9159-1-wangdeming@inspur.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.200.104.82] tUid: 2022706170357e98e00458c131b46b68ac306b16c623e X-Abuse-Reports-To: service@corp-email.com Abuse-Reports-To: service@corp-email.com X-Complaints-To: service@corp-email.com X-Report-Abuse-To: service@corp-email.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The function apic_has_interrupt_for_ppr and the function kvm_apic_is_broadcast_dest should follow the same style as other codes. Signed-off-by: Deming Wang --- arch/x86/kvm/lapic.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index f03facc2ee3e..d8940486878d 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -739,12 +739,14 @@ static bool pv_eoi_test_and_clr_pending(struct kvm_vc= pu *vcpu) static int apic_has_interrupt_for_ppr(struct kvm_lapic *apic, u32 ppr) { int highest_irr; + if (kvm_x86_ops.sync_pir_to_irr) highest_irr =3D static_call(kvm_x86_sync_pir_to_irr)(apic->vcpu); else highest_irr =3D apic_find_highest_irr(apic); if (highest_irr =3D=3D -1 || (highest_irr & 0xF0) <=3D ppr) return -1; + return highest_irr; } =20 @@ -932,6 +934,7 @@ static bool kvm_apic_is_broadcast_dest(struct kvm *kvm,= struct kvm_lapic **src, return true; } else { bool x2apic_ipi =3D src && *src && apic_x2apic_mode(*src); + if (irq->dest_id =3D=3D (x2apic_ipi ? X2APIC_BROADCAST : APIC_BROADCAST)) return true; --=20 2.27.0