GNU/Weeb Mailing List <[email protected]>
 help / color / mirror / Atom feed
From: Ammar Faizi <[email protected]>
To: Jens Axboe <[email protected]>
Cc: Pavel Begunkov <[email protected]>,
	io-uring Mailing List <[email protected]>,
	GNU/Weeb Mailing List <[email protected]>,
	Muhammad Rizki <[email protected]>,
	Alviro Iskandar Setiawan <[email protected]>,
	Gilang Fachrezy <[email protected]>,
	[email protected], Ammar Faizi <[email protected]>
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: <[email protected]> (raw)
In-Reply-To: <[email protected]>

From: Ammar Faizi <[email protected]>

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 <[email protected]>
---
 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 12:54 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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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