From: Ammar Faizi <ammarfaizi2@gnuweeb.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: Ammar Faizi <ammarfaizi2@gnuweeb.org>,
Muhammad Rizki <kiizuha@gnuweeb.org>,
Kanna Scarlet <knscarlet@gnuweeb.org>,
io-uring Mailing List <io-uring@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
GNU/Weeb Mailing List <gwml@vger.gnuweeb.org>
Subject: [PATCH liburing v1 3/3] queue: Remove unnecessary goto and label
Date: Wed, 31 Aug 2022 07:48:17 +0700 [thread overview]
Message-ID: <20220831004449.2619220-4-ammar.faizi@intel.com> (raw)
In-Reply-To: <20220831004449.2619220-1-ammar.faizi@intel.com>
From: Ammar Faizi <ammarfaizi2@gnuweeb.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@gnuweeb.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
next prev parent reply other threads:[~2022-08-31 0:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-31 0:48 [PATCH liburing v1 0/3] liburing updates Ammar Faizi
2022-08-31 0:48 ` [PATCH liburing v1 1/3] github bot: Upgrade clang version to 16 Ammar Faizi
2022-08-31 0:48 ` [PATCH liburing v1 2/3] CHANGELOG: Note about `io_uring_{enter,enter2,register,setup}` Ammar Faizi
2022-08-31 0:48 ` Ammar Faizi [this message]
2022-08-31 1:00 ` [PATCH liburing v1 0/3] liburing updates Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220831004449.2619220-4-ammar.faizi@intel.com \
--to=ammarfaizi2@gnuweeb.org \
--cc=axboe@kernel.dk \
--cc=gwml@vger.gnuweeb.org \
--cc=io-uring@vger.kernel.org \
--cc=kiizuha@gnuweeb.org \
--cc=knscarlet@gnuweeb.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®