Linux io-uring development
 help / color / mirror / Atom feed
From: Caleb Sander Mateos <csander@purestorage.com>
To: Jens Axboe <axboe@kernel.dk>, Pavel Begunkov <asml.silence@gmail.com>
Cc: Caleb Sander Mateos <csander@purestorage.com>,
	io-uring@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] io_uring/waitid: remove #ifdef CONFIG_COMPAT
Date: Mon, 24 Feb 2025 10:23:36 -0700	[thread overview]
Message-ID: <20250224172337.2009871-1-csander@purestorage.com> (raw)

io_is_compat() is already defined to return false if CONFIG_COMPAT is
disabled. So remove the additional #ifdef CONFIG_COMPAT guards. Let the
compiler optimize out the dead code when CONFIG_COMPAT is disabled.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
---
 io_uring/waitid.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/io_uring/waitid.c b/io_uring/waitid.c
index 4034b7e3026f..54e69984cd8a 100644
--- a/io_uring/waitid.c
+++ b/io_uring/waitid.c
@@ -40,11 +40,10 @@ static void io_waitid_free(struct io_kiocb *req)
 	kfree(req->async_data);
 	req->async_data = NULL;
 	req->flags &= ~REQ_F_ASYNC_DATA;
 }
 
-#ifdef CONFIG_COMPAT
 static bool io_waitid_compat_copy_si(struct io_waitid *iw, int signo)
 {
 	struct compat_siginfo __user *infop;
 	bool ret;
 
@@ -65,24 +64,21 @@ static bool io_waitid_compat_copy_si(struct io_waitid *iw, int signo)
 	return ret;
 Efault:
 	ret = false;
 	goto done;
 }
-#endif
 
 static bool io_waitid_copy_si(struct io_kiocb *req, int signo)
 {
 	struct io_waitid *iw = io_kiocb_to_cmd(req, struct io_waitid);
 	bool ret;
 
 	if (!iw->infop)
 		return true;
 
-#ifdef CONFIG_COMPAT
 	if (io_is_compat(req->ctx))
 		return io_waitid_compat_copy_si(iw, signo);
-#endif
 
 	if (!user_write_access_begin(iw->infop, sizeof(*iw->infop)))
 		return false;
 
 	unsafe_put_user(signo, &iw->infop->si_signo, Efault);
-- 
2.45.2


             reply	other threads:[~2025-02-24 17:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-24 17:23 Caleb Sander Mateos [this message]
2025-02-24 17:44 ` [PATCH] io_uring/waitid: remove #ifdef CONFIG_COMPAT Jens Axboe
2025-02-24 17:53   ` Caleb Sander Mateos
2025-02-24 17:55     ` Jens Axboe
2025-02-24 19:10       ` Pavel Begunkov
2025-02-24 19:10         ` Jens Axboe
2025-02-24 19:11 ` 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=20250224172337.2009871-1-csander@purestorage.com \
    --to=csander@purestorage.com \
    --cc=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.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