@@ -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;
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(-)