LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] kvm: x86: i8259: Converts mask values to logical binary values.
@ 2021-09-11  3:27 18341265598
  2021-09-11  3:32 ` H. Peter Anvin
  0 siblings, 1 reply; 2+ messages in thread
From: 18341265598 @ 2021-09-11  3:27 UTC (permalink / raw)
  To: Paolo Bonzini, Sean Christopherson, Vitaly Kuznetsov, Wanpeng Li,
	Jim Mattson, Joerg Roedel, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, x86, H . Peter Anvin
  Cc: kvm, linux-kernel, Zhaoge Zhang

From: Zhaoge Zhang <18341265598@163.com>

Signed-off-by: Zhaoge Zhang <18341265598@163.com>
---
 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;
-- 
2.7.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] kvm: x86: i8259: Converts mask values to logical binary values.
  2021-09-11  3:27 [PATCH] kvm: x86: i8259: Converts mask values to logical binary values 18341265598
@ 2021-09-11  3:32 ` H. Peter Anvin
  0 siblings, 0 replies; 2+ messages in thread
From: H. Peter Anvin @ 2021-09-11  3:32 UTC (permalink / raw)
  To: 18341265598, Paolo Bonzini, Sean Christopherson,
	Vitaly Kuznetsov, Wanpeng Li, Jim Mattson, Joerg Roedel,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86
  Cc: kvm, linux-kernel, Zhaoge Zhang

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

On September 10, 2021 8:27:21 PM PDT, 18341265598@163.com wrote:
>From: Zhaoge Zhang <18341265598@163.com>
>
>Signed-off-by: Zhaoge Zhang <18341265598@163.com>
>---
> 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-11  3:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-11  3:27 [PATCH] kvm: x86: i8259: Converts mask values to logical binary values 18341265598
2021-09-11  3:32 ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).