mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wang Guangju <wangguangju@baidu.com>
To: <pbonzini@redhat.com>, <sean.j.christopherson@intel.com>,
	<vkuznets@redhat.com>, <wanpengli@tencent.com>,
	<jmattson@google.com>, <joro@8bytes.org>, <kvm@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <wangguangju@baidu.com>
Subject: [PATCH] KVM: x86: enhance the readability of function pic_intack()
Date: Wed, 12 Jan 2022 16:51:53 +0800	[thread overview]
Message-ID: <20220112085153.4506-1-wangguangju@baidu.com> (raw)

From: wangguangju <wangguangju@baidu.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@baidu.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


             reply	other threads:[~2022-01-13  9:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-12  8:51 Wang Guangju [this message]
2022-01-15  0:46 ` Sean Christopherson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220112085153.4506-1-wangguangju@baidu.com \
    --to=wangguangju@baidu.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=sean.j.christopherson@intel.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®