Skip to contentSkip to conversation

io_uring/waitid: remove #ifdef CONFIG_COMPAT

PATCH Applied Caleb Sander Mateos 3 participants 7 messages Feb 24, 2025 io_uring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io_uring/waitid: remove #ifdef CONFIG_COMPAT

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.

---
 io_uring/waitid.c | 4 ----
 1 file changed, 4 deletions(-)
io_uring/waitid.c +0 -4
index 4034b7e3026f..54e69984cd8a 100644
@@ -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);
Signature · 1 line
2.45.2
maintainer
#1 lore raw
Quoted 3 lines · Caleb Sander Mateos

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.

Would you mind if I fold this into Pavel's patch? I can keep it standalone too, just let me know.

Signature · 1 line
Jens Axboe
#2 lore raw
Quoted 8 lines · Jens Axboe
Quoted 3 lines · Caleb Sander Mateos

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.

Would you mind if I fold this into Pavel's patch? I can keep it standalone too, just let me know.

Fine by me, though I thought Pavel was suggesting keeping it separate:
https://lore.kernel.org/io-uring/[email protected]/T/#u

Thanks,
Caleb

maintainer
#3 lore raw
Quoted 7 lines · Caleb Sander Mateos
Quoted 6 lines · Jens Axboe
Quoted 3 lines · Caleb Sander Mateos

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.

Quoted 5 lines
Quoted 2 lines

Would you mind if I fold this into Pavel's patch? I can keep it standalone too, just let me know.

Fine by me, though I thought Pavel was suggesting keeping it separate:
https://lore.kernel.org/io-uring/[email protected]/T/#u

I'm reading it as he has other stuff that will go on top. I don't see any reason to double stage this part, might as well remove the CONFIG dependency at the same time, if it's doable.

Pavel?

Signature · 1 line
Jens Axboe
#4 lore raw
Quoted 11 lines · Jens Axboe
Quoted 10 lines · Caleb Sander Mateos
Quoted 8 lines · Jens Axboe
Quoted 3 lines · Caleb Sander Mateos

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.

Would you mind if I fold this into Pavel's patch? I can keep it standalone too, just let me know.

Quoted 8 lines
Quoted 2 lines

Fine by me, though I thought Pavel was suggesting keeping it separate:
https://lore.kernel.org/io-uring/[email protected]/T/#u

I'm reading it as he has other stuff that will go on top. I don't see any reason to double stage this part, might as well remove the CONFIG dependency at the same time, if it's doable.

Pavel?

I'm not sure why you'd want that, but I don't mind

Signature · 1 line
Pavel Begunkov
maintainer
#5 lore raw
Quoted 15 lines · Pavel Begunkov
Quoted 14 lines · Jens Axboe
Quoted 12 lines · Caleb Sander Mateos
Quoted 8 lines · On Mon, Feb 24, 2025 at 9:44?AM Jens Axboe <[email protected]> wrote:
Quoted 3 lines · Caleb Sander Mateos

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.

Would you mind if I fold this into Pavel's patch? I can keep it standalone too, just let me know.

Fine by me, though I thought Pavel was suggesting keeping it separate:
https://lore.kernel.org/io-uring/[email protected]/T/#u

Quoted 7 lines
Quoted 5 lines

I'm reading it as he has other stuff that will go on top. I don't see any reason to double stage this part, might as well remove the CONFIG dependency at the same time, if it's doable.

Pavel?

I'm not sure why you'd want that, but I don't mind

Just because it imho should've been in the initial commit, so I'd consider it more of a fixup commit. But if you're fine with it, I'll fold it in with a note.

Signature · 1 line
Jens Axboe
maintainer Applied
#6 lore raw
In reply to Caleb Sander Mateos
Quoted 5 lines · Caleb Sander Mateos

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.

Applied, thanks!

[1/1] io_uring/waitid: remove #ifdef CONFIG_COMPAT

      commit: 0cd64345c4ba127d27fa07a133d108ea92d38361

Best regards,

Signature · 1 line
Jens Axboe