diff mbox series

[liburing,v1,1/3] liburing.h: Remove redundant double negation

Message ID 20250220143422.3597245-2-ammarfaizi2@gnuweeb.org (mailing list archive)
State New
Headers show
Series Fix Compilation Error on Android and Some Cleanup | expand

Commit Message

Ammar Faizi Feb. 20, 2025, 2:34 p.m. UTC
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 mbox series

Patch

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;