[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220831004449.2619220-4-ammar.faizi@intel.com>
Date: Wed, 31 Aug 2022 07:48:17 +0700
From: Ammar Faizi <ammarfaizi2@...weeb.org>
To: Jens Axboe <axboe@...nel.dk>
Cc: Ammar Faizi <ammarfaizi2@...weeb.org>,
Muhammad Rizki <kiizuha@...weeb.org>,
Kanna Scarlet <knscarlet@...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 3/3] queue: Remove unnecessary goto and label
From: Ammar Faizi <ammarfaizi2@...weeb.org>
This 'goto done' and 'done:' label are not needed, there is no cleanup
needed in this path. Simplify it. Just return 0 directly.
Signed-off-by: Ammar Faizi <ammarfaizi2@...weeb.org>
---
src/queue.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/queue.c b/src/queue.c
index 277cdcc..a670a8e 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -158,25 +158,24 @@ again:
cqes[i] = &ring->cq.cqes[(head & mask) << shift];
return count;
}
if (overflow_checked)
- goto done;
+ return 0;
if (cq_ring_needs_flush(ring)) {
int flags = IORING_ENTER_GETEVENTS;
if (ring->int_flags & INT_FLAG_REG_RING)
flags |= IORING_ENTER_REGISTERED_RING;
__sys_io_uring_enter(ring->enter_ring_fd, 0, 0, flags, NULL);
overflow_checked = true;
goto again;
}
-done:
return 0;
}
/*
* Sync internal state with kernel ring state on the SQ side. Returns the
* number of pending items in the SQ ring, for the shared ring.
--
Ammar Faizi
Powered by blists - more mailing lists