From: Jason Yan <yanaijie@huawei.com>
To: <pbonzini@redhat.com>, <peterx@redhat.com>, <tglx@linutronix.de>,
<kvm@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: Jason Yan <yanaijie@huawei.com>
Subject: [PATCH] kvm/eventfd: remove unneeded conversion to bool
Date: Mon, 20 Apr 2020 20:38:05 +0800 [thread overview]
Message-ID: <20200420123805.4494-1-yanaijie@huawei.com> (raw)
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
next reply other threads:[~2020-04-20 12:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-20 12:38 Jason Yan [this message]
2020-04-20 13:51 ` [PATCH] kvm/eventfd: remove unneeded conversion to bool Peter Xu
2020-04-21 16:08 ` Paolo Bonzini
2020-04-25 10:43 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200420123805.4494-1-yanaijie@huawei.com \
--to=yanaijie@huawei.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).