From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server-vie001.gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_DBL_BLOCKED_OPENDNS, URIBL_ZEN_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=3.4.6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1740062095; bh=NXzmlJbcyvCFApkcvBVHzM26nc8bwg9PTyW6PRPeox4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Message-ID:Date:From: Reply-To:Subject:To:Cc:In-Reply-To:References:Resent-Date: Resent-From:Resent-To:Resent-Cc:User-Agent:Content-Type: Content-Transfer-Encoding; b=rl6CRDA9zzbIVO5XlJXKxJ9ifgO0vgYJmlRFNbINzNSaIK6Nwi3wawzFZ6cuRiqCs ToclivVe6TTC0Oqfu+TTQe1BUPH8kB6SymxNgc+osWFh1ktrMYyX7JQjfzBHw1pmcW zb8wuelI130vzcbeDuQVFRfTBcCRawrSPnNax5YlOPy6JdRHKXYZ0zDo7Dl5/ISwOu jonfT+8200Zw5Eopq5ztwSWKkHqESFUIPK43gnJ0IcOg2JVKovAhJwBfJIPzeDZlVS i959gG2ORFC1JfzBnFA9Zj5GYfugmmAlX/8aP299O9se8/W973vRDAZH34QL2FrTyW OrMViV/d0EmtA== Received: from integral2.. (unknown [182.253.126.96]) by server-vie001.gnuweeb.org (Postfix) with ESMTPSA id F1D3720744A4; Thu, 20 Feb 2025 14:34:53 +0000 (UTC) From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Alviro Iskandar Setiawan , io-uring Mailing List , Linux Kernel Mailing List , GNU/Weeb Mailing List Subject: [PATCH liburing v1 1/3] liburing.h: Remove redundant double negation Date: Thu, 20 Feb 2025 21:34:20 +0700 Message-Id: <20250220143422.3597245-2-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250220143422.3597245-1-ammarfaizi2@gnuweeb.org> References: <20250220143422.3597245-1-ammarfaizi2@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 --- 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