[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220112085153.4506-1-wangguangju@baidu.com>
Date: Wed, 12 Jan 2022 16:51:53 +0800
From: Wang Guangju <wangguangju@...du.com>
To: <pbonzini@...hat.com>, <sean.j.christopherson@...el.com>,
<vkuznets@...hat.com>, <wanpengli@...cent.com>,
<jmattson@...gle.com>, <joro@...tes.org>, <kvm@...r.kernel.org>
CC: <linux-kernel@...r.kernel.org>, <wangguangju@...du.com>
Subject: [PATCH] KVM: x86: enhance the readability of function pic_intack()
From: wangguangju <wangguangju@...du.com>
In function pic_intack(), use a varibale of "mask" to
record expression of "1 << irq", so we can enhance the
readability of this function.
Signed-off-by: wangguangju <wangguangju@...du.com>
---
arch/x86/kvm/i8259.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c
index 814064d06016..ad6b64b11adc 100644
--- a/arch/x86/kvm/i8259.c
+++ b/arch/x86/kvm/i8259.c
@@ -216,12 +216,14 @@ void kvm_pic_clear_all(struct kvm_pic *s, int irq_source_id)
*/
static inline void pic_intack(struct kvm_kpic_state *s, int irq)
{
- s->isr |= 1 << irq;
+ int mask;
+ mask = 1 << irq;
+ s->isr |= mask;
/*
* We don't clear a level sensitive interrupt here
*/
- if (!(s->elcr & (1 << irq)))
- s->irr &= ~(1 << irq);
+ if (!(s->elcr & mask))
+ s->irr &= ~mask;
if (s->auto_eoi) {
if (s->rotate_on_auto_eoi)
--
2.25.1
Powered by blists - more mailing lists