[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7a0d78d8-e5db-30fb-a2a2-62113a791e49@redhat.com>
Date: Tue, 21 Apr 2020 18:08:13 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Jason Yan <yanaijie@...wei.com>, peterx@...hat.com,
tglx@...utronix.de, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kvm/eventfd: remove unneeded conversion to bool
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@...wei.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
Powered by blists - more mailing lists