[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250220143422.3597245-2-ammarfaizi2@gnuweeb.org>
Date: Thu, 20 Feb 2025 21:34:20 +0700
From: Ammar Faizi <ammarfaizi2@...weeb.org>
To: Jens Axboe <axboe@...nel.dk>
Cc: Ammar Faizi <ammarfaizi2@...weeb.org>,
Alviro Iskandar Setiawan <alviro.iskandar@...weeb.org>,
io-uring Mailing List <io-uring@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
GNU/Weeb Mailing List <gwml@...r.gnuweeb.org>
Subject: [PATCH liburing v1 1/3] liburing.h: Remove redundant double negation
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@...weeb.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
Powered by blists - more mailing lists