lkml.org 
[lkml]   [2022]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH liburing v1 3/3] queue: Remove unnecessary goto and label
Date
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
\
 
 \ /
  Last update: 2022-08-31 02:49    [W:0.081 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site