Re: [PATCH] kvm: x86: i8259: Converts mask values to logical binary values.

From: H. Peter Anvin
Date: Fri Sep 10 2021 - 23:33:47 EST


! is already booleanizing. There is no need to use !!!.

On September 10, 2021 8:27:21 PM PDT, 18341265598@xxxxxxx wrote:
>From: Zhaoge Zhang <18341265598@xxxxxxx>
>
>Signed-off-by: Zhaoge Zhang <18341265598@xxxxxxx>
>---
> arch/x86/kvm/i8259.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c
>index 0b80263..a8f1d60 100644
>--- a/arch/x86/kvm/i8259.c
>+++ b/arch/x86/kvm/i8259.c
>@@ -92,7 +92,7 @@ static inline int pic_set_irq1(struct kvm_kpic_state *s, int irq, int level)
> mask = 1 << irq;
> if (s->elcr & mask) /* level triggered */
> if (level) {
>- ret = !(s->irr & mask);
>+ ret = !!!(s->irr & mask);
> s->irr |= mask;
> s->last_irr |= mask;
> } else {
>@@ -102,7 +102,7 @@ static inline int pic_set_irq1(struct kvm_kpic_state *s, int irq, int level)
> else /* edge triggered */
> if (level) {
> if ((s->last_irr & mask) == 0) {
>- ret = !(s->irr & mask);
>+ ret = !!!(s->irr & mask);
> s->irr |= mask;
> }
> s->last_irr |= mask;

--
Sent from my Android device with K-9 Mail. Please excuse my brevity.