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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---
 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





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux