kvm/eventfd: remove unneeded conversion to bool
authorJason Yan <yanaijie@huawei.com>
Mon, 20 Apr 2020 12:38:05 +0000 (20:38 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 13 May 2020 16:14:58 +0000 (12:14 -0400)
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>
Message-Id: <20200420123805.4494-1-yanaijie@huawei.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/eventfd.c

index 67b6fc153e9c4175270174bd8d2b2a8fc6c49109..0c4ede45e6bd601fbcdb86140866c89c764ca6b1 100644 (file)
@@ -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 */