All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kvm/eventfd: remove unneeded conversion to bool
@ 2020-04-20 12:38 Jason Yan
  2020-04-20 13:51 ` Peter Xu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jason Yan @ 2020-04-20 12:38 UTC (permalink / raw)
  To: pbonzini, peterx, tglx, kvm, linux-kernel; +Cc: Jason Yan

The '==' expression itself is bool, no need to convert it to bool again.
This fixes the following coccicheck warning:

virt/kvm/eventfd.c:724:38-43: WARNING: conversion to bool not needed
here

Signed-off-by: Jason Yan <yanaijie@huawei.com>
---
 virt/kvm/eventfd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
index 67b6fc153e9c..0c4ede45e6bd 100644
--- a/virt/kvm/eventfd.c
+++ b/virt/kvm/eventfd.c
@@ -721,7 +721,7 @@ ioeventfd_in_range(struct _ioeventfd *p, gpa_t addr, int len, const void *val)
 		return false;
 	}
 
-	return _val == p->datamatch ? true : false;
+	return _val == p->datamatch;
 }
 
 /* MMIO/PIO writes trigger an event if the addr/val match */
-- 
2.21.1


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

* Re: [PATCH] kvm/eventfd: remove unneeded conversion to bool
  2020-04-20 12:38 [PATCH] kvm/eventfd: remove unneeded conversion to bool Jason Yan
@ 2020-04-20 13:51 ` Peter Xu
  2020-04-21 16:08 ` Paolo Bonzini
  2020-04-25 10:43 ` Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Xu @ 2020-04-20 13:51 UTC (permalink / raw)
  To: Jason Yan; +Cc: pbonzini, tglx, kvm, linux-kernel

On Mon, Apr 20, 2020 at 08:38:05PM +0800, Jason Yan wrote:
> The '==' expression itself is bool, no need to convert it to bool again.
> This fixes the following coccicheck warning:
> 
> virt/kvm/eventfd.c:724:38-43: WARNING: conversion to bool not needed
> here
> 
> Signed-off-by: Jason Yan <yanaijie@huawei.com>

Reviewed-by: Peter Xu <peterx@redhat.com>

-- 
Peter Xu


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

* Re: [PATCH] kvm/eventfd: remove unneeded conversion to bool
  2020-04-20 12:38 [PATCH] kvm/eventfd: remove unneeded conversion to bool Jason Yan
  2020-04-20 13:51 ` Peter Xu
@ 2020-04-21 16:08 ` Paolo Bonzini
  2020-04-25 10:43 ` Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2020-04-21 16:08 UTC (permalink / raw)
  To: Jason Yan, peterx, tglx, kvm, linux-kernel

On 20/04/20 14:38, Jason Yan wrote:
> The '==' expression itself is bool, no need to convert it to bool again.
> This fixes the following coccicheck warning:
> 
> virt/kvm/eventfd.c:724:38-43: WARNING: conversion to bool not needed
> here
> 
> Signed-off-by: Jason Yan <yanaijie@huawei.com>
> ---
>  virt/kvm/eventfd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
> index 67b6fc153e9c..0c4ede45e6bd 100644
> --- a/virt/kvm/eventfd.c
> +++ b/virt/kvm/eventfd.c
> @@ -721,7 +721,7 @@ ioeventfd_in_range(struct _ioeventfd *p, gpa_t addr, int len, const void *val)
>  		return false;
>  	}
>  
> -	return _val == p->datamatch ? true : false;
> +	return _val == p->datamatch;
>  }
>  
>  /* MMIO/PIO writes trigger an event if the addr/val match */
> 

Queued, thanks.

Paolo


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

* Re: [PATCH] kvm/eventfd: remove unneeded conversion to bool
  2020-04-20 12:38 [PATCH] kvm/eventfd: remove unneeded conversion to bool Jason Yan
  2020-04-20 13:51 ` Peter Xu
  2020-04-21 16:08 ` Paolo Bonzini
@ 2020-04-25 10:43 ` Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2020-04-25 10:43 UTC (permalink / raw)
  To: Jason Yan, peterx, tglx, kvm, linux-kernel

On 20/04/20 14:38, Jason Yan wrote:
> The '==' expression itself is bool, no need to convert it to bool again.
> This fixes the following coccicheck warning:
> 
> virt/kvm/eventfd.c:724:38-43: WARNING: conversion to bool not needed
> here
> 
> Signed-off-by: Jason Yan <yanaijie@huawei.com>
> ---
>  virt/kvm/eventfd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
> index 67b6fc153e9c..0c4ede45e6bd 100644
> --- a/virt/kvm/eventfd.c
> +++ b/virt/kvm/eventfd.c
> @@ -721,7 +721,7 @@ ioeventfd_in_range(struct _ioeventfd *p, gpa_t addr, int len, const void *val)
>  		return false;
>  	}
>  
> -	return _val == p->datamatch ? true : false;
> +	return _val == p->datamatch;
>  }
>  
>  /* MMIO/PIO writes trigger an event if the addr/val match */
> 

Queued, thanks.

Paolo


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

end of thread, other threads:[~2020-04-25 10:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-20 12:38 [PATCH] kvm/eventfd: remove unneeded conversion to bool Jason Yan
2020-04-20 13:51 ` Peter Xu
2020-04-21 16:08 ` Paolo Bonzini
2020-04-25 10:43 ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.