[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YeIZTkYCfkTE0Lob@google.com>
Date: Sat, 15 Jan 2022 00:46:06 +0000
From: Sean Christopherson <seanjc@...gle.com>
To: Wang Guangju <wangguangju@...du.com>
Cc: pbonzini@...hat.com, sean.j.christopherson@...el.com,
vkuznets@...hat.com, wanpengli@...cent.com, jmattson@...gle.com,
joro@...tes.org, kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] KVM: x86: enhance the readability of function
pic_intack()
On Wed, Jan 12, 2022, Wang Guangju wrote:
> 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.
Please wrap at ~75 chars.
> 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;
Needs a newline, and could also be:
int mask = 1 << irq;
or even
int mask = BIT(irq);
That said, I oddly find the existing code more readable. Maybe "irq_mask" instead
of "mask"? Dunno. I guess I don't have a strong opinion :-)
Powered by blists - more mailing lists