From: Ammar Faizi <ammarfaizi2@gnuweeb.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: Ammar Faizi <ammarfaizi2@gnuweeb.org>,
Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>,
io-uring Mailing List <io-uring@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
GNU/Weeb Mailing List <gwml@vger.gnuweeb.org>
Subject: [PATCH liburing v1 1/3] liburing.h: Remove redundant double negation
Date: Thu, 20 Feb 2025 21:34:20 +0700 [thread overview]
Message-ID: <20250220143422.3597245-2-ammarfaizi2@gnuweeb.org> (raw)
In-Reply-To: <20250220143422.3597245-1-ammarfaizi2@gnuweeb.org>
The `enabled` variable is already a boolean, so applying the negation
operator twice has no effect. Remove it to improves clarity and
simplicity.
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
---
src/include/liburing.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/liburing.h b/src/include/liburing.h
index 6393599cb3bf..b2d76f3224e2 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -1410,25 +1410,25 @@ IOURINGINLINE bool io_uring_cq_eventfd_enabled(const struct io_uring *ring)
return !(*ring->cq.kflags & IORING_CQ_EVENTFD_DISABLED);
}
/*
* Toggle eventfd notification on or off, if an eventfd is registered with
* the ring.
*/
IOURINGINLINE int io_uring_cq_eventfd_toggle(struct io_uring *ring,
bool enabled)
{
uint32_t flags;
- if (!!enabled == io_uring_cq_eventfd_enabled(ring))
+ if (enabled == io_uring_cq_eventfd_enabled(ring))
return 0;
if (!ring->cq.kflags)
return -EOPNOTSUPP;
flags = *ring->cq.kflags;
if (enabled)
flags &= ~IORING_CQ_EVENTFD_DISABLED;
else
flags |= IORING_CQ_EVENTFD_DISABLED;
--
Ammar Faizi
next prev parent reply other threads:[~2025-02-20 14:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-20 14:34 [PATCH liburing v1 0/3] Fix Compilation Error on Android and Some Cleanup Ammar Faizi
2025-02-20 14:34 ` Ammar Faizi [this message]
2025-02-20 14:34 ` [PATCH liburing v1 2/3] liburing.h: Explain the history of `io_uring_get_sqe()` Ammar Faizi
2025-02-20 14:34 ` [PATCH liburing v1 3/3] Fix missing `aligned_alloc()` on some Android devices Ammar Faizi
2025-02-20 14:51 ` [PATCH liburing v1 0/3] Fix Compilation Error on Android and Some Cleanup Jens Axboe
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=20250220143422.3597245-2-ammarfaizi2@gnuweeb.org \
--to=ammarfaizi2@gnuweeb.org \
--cc=alviro.iskandar@gnuweeb.org \
--cc=axboe@kernel.dk \
--cc=gwml@vger.gnuweeb.org \
--cc=io-uring@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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