From: Ammar Faizi <[email protected]>
To: Jens Axboe <[email protected]>
Cc: Ammar Faizi <[email protected]>,
Alviro Iskandar Setiawan <[email protected]>,
io-uring Mailing List <[email protected]>,
Linux Kernel Mailing List <[email protected]>,
GNU/Weeb Mailing List <[email protected]>
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: <[email protected]> (raw)
In-Reply-To: <[email protected]>
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 <[email protected]>
---
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:34 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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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