public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] io_uring: Trim out unused includes
@ 2026-01-05 23:09 Gabriel Krisman Bertazi
  2026-01-06  0:13 ` Jens Axboe
  2026-01-12 12:11 ` Breno Leitao
  0 siblings, 2 replies; 6+ messages in thread
From: Gabriel Krisman Bertazi @ 2026-01-05 23:09 UTC (permalink / raw)
  To: axboe; +Cc: io-uring, Gabriel Krisman Bertazi

Clean up some left overs of refactoring io_uring into multiple files.
Compile tested with a few configurations.

Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
---
 io_uring/alloc_cache.h |  1 +
 io_uring/cancel.c      |  2 --
 io_uring/filetable.h   |  1 -
 io_uring/io_uring.c    | 12 ------------
 io_uring/io_uring.h    |  1 -
 5 files changed, 1 insertion(+), 16 deletions(-)

diff --git a/io_uring/alloc_cache.h b/io_uring/alloc_cache.h
index d33ce159ef33..bb2f21a7bfd6 100644
--- a/io_uring/alloc_cache.h
+++ b/io_uring/alloc_cache.h
@@ -2,6 +2,7 @@
 #define IOU_ALLOC_CACHE_H
 
 #include <linux/io_uring_types.h>
+#include <linux/kasan.h>
 
 /*
  * Don't allow the cache to grow beyond this size.
diff --git a/io_uring/cancel.c b/io_uring/cancel.c
index ca12ac10c0ae..38452ab06098 100644
--- a/io_uring/cancel.c
+++ b/io_uring/cancel.c
@@ -2,10 +2,8 @@
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
-#include <linux/file.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
-#include <linux/namei.h>
 #include <linux/nospec.h>
 #include <linux/io_uring.h>
 
diff --git a/io_uring/filetable.h b/io_uring/filetable.h
index 7717ea9efd0e..c348233a3411 100644
--- a/io_uring/filetable.h
+++ b/io_uring/filetable.h
@@ -2,7 +2,6 @@
 #ifndef IOU_FILE_TABLE_H
 #define IOU_FILE_TABLE_H
 
-#include <linux/file.h>
 #include <linux/io_uring_types.h>
 #include "rsrc.h"
 
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 6cb24cdf8e68..0d812042e38f 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -40,37 +40,25 @@
  * Copyright (c) 2018-2019 Christoph Hellwig
  */
 #include <linux/kernel.h>
-#include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/syscalls.h>
-#include <net/compat.h>
 #include <linux/refcount.h>
-#include <linux/uio.h>
 #include <linux/bits.h>
 
 #include <linux/sched/signal.h>
 #include <linux/fs.h>
-#include <linux/file.h>
 #include <linux/mm.h>
-#include <linux/mman.h>
 #include <linux/percpu.h>
 #include <linux/slab.h>
-#include <linux/bvec.h>
-#include <linux/net.h>
-#include <net/sock.h>
 #include <linux/anon_inodes.h>
-#include <linux/sched/mm.h>
 #include <linux/uaccess.h>
 #include <linux/nospec.h>
-#include <linux/fsnotify.h>
-#include <linux/fadvise.h>
 #include <linux/task_work.h>
 #include <linux/io_uring.h>
 #include <linux/io_uring/cmd.h>
 #include <linux/audit.h>
 #include <linux/security.h>
 #include <linux/jump_label.h>
-#include <asm/shmparam.h>
 
 #define CREATE_TRACE_POINTS
 #include <trace/events/io_uring.h>
diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h
index a790c16854d3..c5bbb43b5842 100644
--- a/io_uring/io_uring.h
+++ b/io_uring/io_uring.h
@@ -4,7 +4,6 @@
 #include <linux/errno.h>
 #include <linux/lockdep.h>
 #include <linux/resume_user_mode.h>
-#include <linux/kasan.h>
 #include <linux/poll.h>
 #include <linux/io_uring_types.h>
 #include <uapi/linux/eventpoll.h>
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] io_uring: Trim out unused includes
  2026-01-05 23:09 [PATCH] io_uring: Trim out unused includes Gabriel Krisman Bertazi
@ 2026-01-06  0:13 ` Jens Axboe
  2026-01-12 12:11 ` Breno Leitao
  1 sibling, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2026-01-06  0:13 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi; +Cc: io-uring


On Mon, 05 Jan 2026 18:09:32 -0500, Gabriel Krisman Bertazi wrote:
> Clean up some left overs of refactoring io_uring into multiple files.
> Compile tested with a few configurations.
> 
> 

Applied, thanks!

[1/1] io_uring: Trim out unused includes
      commit: 48ed70131e4f3057f819c848d92fe84ba696e2a9

Best regards,
-- 
Jens Axboe




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] io_uring: Trim out unused includes
  2026-01-05 23:09 [PATCH] io_uring: Trim out unused includes Gabriel Krisman Bertazi
  2026-01-06  0:13 ` Jens Axboe
@ 2026-01-12 12:11 ` Breno Leitao
  2026-01-12 14:36   ` Gabriel Krisman Bertazi
  1 sibling, 1 reply; 6+ messages in thread
From: Breno Leitao @ 2026-01-12 12:11 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi; +Cc: axboe, io-uring

Hello Gabriel,

On Mon, Jan 05, 2026 at 06:09:32PM -0500, Gabriel Krisman Bertazi wrote:
> Clean up some left overs of refactoring io_uring into multiple files.
> Compile tested with a few configurations.

Do you have a tool to detect those unused header? I am curious how is
the process to discover unused headers in .c files.

Thanks
--breno

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] io_uring: Trim out unused includes
  2026-01-12 12:11 ` Breno Leitao
@ 2026-01-12 14:36   ` Gabriel Krisman Bertazi
  2026-01-12 15:39     ` Breno Leitao
  0 siblings, 1 reply; 6+ messages in thread
From: Gabriel Krisman Bertazi @ 2026-01-12 14:36 UTC (permalink / raw)
  To: Breno Leitao; +Cc: axboe, io-uring

Breno Leitao <leitao@debian.org> writes:

> Do you have a tool to detect those unused header? I am curious how is
> the process to discover unused headers in .c files.

No.  I noticed one that was obviously wrong and that caused me to
manually walk over the rest that looked suspicious.  I probably missed
some in the process.

I suppose LLMs, if you can stomach those, would help :)

-- 
Gabriel Krisman Bertazi

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] io_uring: Trim out unused includes
  2026-01-12 14:36   ` Gabriel Krisman Bertazi
@ 2026-01-12 15:39     ` Breno Leitao
  2026-01-12 16:20       ` Caleb Sander Mateos
  0 siblings, 1 reply; 6+ messages in thread
From: Breno Leitao @ 2026-01-12 15:39 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi; +Cc: axboe, io-uring

On Mon, Jan 12, 2026 at 09:36:23AM -0500, Gabriel Krisman Bertazi wrote:
> Breno Leitao <leitao@debian.org> writes:
> 
> > Do you have a tool to detect those unused header? I am curious how is
> > the process to discover unused headers in .c files.
> 
> No.  I noticed one that was obviously wrong and that caused me to
> manually walk over the rest that looked suspicious.  I probably missed
> some in the process.

That is fair, I do the same for my code as well.

Thanks
--breno

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] io_uring: Trim out unused includes
  2026-01-12 15:39     ` Breno Leitao
@ 2026-01-12 16:20       ` Caleb Sander Mateos
  0 siblings, 0 replies; 6+ messages in thread
From: Caleb Sander Mateos @ 2026-01-12 16:20 UTC (permalink / raw)
  To: Breno Leitao; +Cc: Gabriel Krisman Bertazi, axboe, io-uring

There is a tool "Include What You Use"
(https://github.com/include-what-you-use/include-what-you-use) that
can be used to automate removing unused includes, among other things.
I've used it in other codebases, though never tried it on Linux.

Best,
Caleb

On Mon, Jan 12, 2026 at 7:46 AM Breno Leitao <leitao@debian.org> wrote:
>
> On Mon, Jan 12, 2026 at 09:36:23AM -0500, Gabriel Krisman Bertazi wrote:
> > Breno Leitao <leitao@debian.org> writes:
> >
> > > Do you have a tool to detect those unused header? I am curious how is
> > > the process to discover unused headers in .c files.
> >
> > No.  I noticed one that was obviously wrong and that caused me to
> > manually walk over the rest that looked suspicious.  I probably missed
> > some in the process.
>
> That is fair, I do the same for my code as well.
>
> Thanks
> --breno
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-01-12 16:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-05 23:09 [PATCH] io_uring: Trim out unused includes Gabriel Krisman Bertazi
2026-01-06  0:13 ` Jens Axboe
2026-01-12 12:11 ` Breno Leitao
2026-01-12 14:36   ` Gabriel Krisman Bertazi
2026-01-12 15:39     ` Breno Leitao
2026-01-12 16:20       ` Caleb Sander Mateos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox