All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ammar Faizi <ammarfaizi2@gnuweeb.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: Pavel Begunkov <asml.silence@gmail.com>,
	io-uring Mailing List <io-uring@vger.kernel.org>,
	GNU/Weeb Mailing List <gwml@vger.gnuweeb.org>,
	Muhammad Rizki <kiizuha@gnuweeb.org>,
	Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>,
	Gilang Fachrezy <gilang4321@gmail.com>,
	kernel@vnlx.org, Ammar Faizi <ammarfaizi2@gnuweeb.org>
Subject: [PATCH liburing v1 3/5] register: Remove useless branch in unregister files
Date: Wed, 23 Nov 2022 19:53:15 +0700	[thread overview]
Message-ID: <20221123124922.3612798-4-ammar.faizi@intel.com> (raw)
In-Reply-To: <20221123124922.3612798-1-ammar.faizi@intel.com>

From: Ammar Faizi <ammarfaizi2@gnuweeb.org>

IORING_UNREGISTER_FILES doesn't return a positive value. This branch
is useless. Remove it.

[1]: io_sqe_files_unregister

Kernel-code-ref: https://github.com/torvalds/linux/blob/v6.1-rc6/io_uring/rsrc.c#L787-L805 [1]
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
---
 src/register.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/register.c b/src/register.c
index adb64cc..c66f63e 100644
--- a/src/register.c
+++ b/src/register.c
@@ -193,11 +193,8 @@ int io_uring_register_files(struct io_uring *ring, const int *files,
 
 int io_uring_unregister_files(struct io_uring *ring)
 {
-	int ret;
-
-	ret = __sys_io_uring_register(ring->ring_fd, IORING_UNREGISTER_FILES,
-				      NULL, 0);
-	return (ret < 0) ? ret : 0;
+	return __sys_io_uring_register(ring->ring_fd, IORING_UNREGISTER_FILES,
+				       NULL, 0);
 }
 
 int io_uring_register_eventfd(struct io_uring *ring, int event_fd)
-- 
Ammar Faizi


  parent reply	other threads:[~2022-11-23 13:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23 12:53 [PATCH liburing v1 0/5] Remove useless brances in register functions Ammar Faizi
2022-11-23 12:53 ` [PATCH liburing v1 1/5] register: Remove useless branches in {un,}register eventfd Ammar Faizi
2022-11-23 12:53 ` [PATCH liburing v1 2/5] register: Remove useless branches in {un,}register buffers Ammar Faizi
2022-11-23 12:53 ` Ammar Faizi [this message]
2022-11-23 12:53 ` [PATCH liburing v1 4/5] register: Remove useless branch in register probe Ammar Faizi
2022-11-23 12:53 ` [PATCH liburing v1 5/5] register: Remove useless branch in register restrictions Ammar Faizi
2022-11-24 13:34 ` [PATCH liburing v1 0/5] Remove useless brances in register functions 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=20221123124922.3612798-4-ammar.faizi@intel.com \
    --to=ammarfaizi2@gnuweeb.org \
    --cc=alviro.iskandar@gnuweeb.org \
    --cc=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=gilang4321@gmail.com \
    --cc=gwml@vger.gnuweeb.org \
    --cc=io-uring@vger.kernel.org \
    --cc=kernel@vnlx.org \
    --cc=kiizuha@gnuweeb.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.