public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Remove unused headers in x86/tools, scripts, pps, input
@ 2026-03-11  3:01 Oli
  2026-03-18 19:56 ` Nicolas Schier
  0 siblings, 1 reply; 2+ messages in thread
From: Oli @ 2026-03-11  3:01 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Steven Rostedt
  Cc: Mathieu Desnoyers, Masami Hiramatsu, Rodolfo Giometti,
	Henrik Rydberg, Dmitry Torokhov, Nathan Chancellor,
	Nicolas Schier, linux-kernel, linux-trace-kernel, linux-kbuild,
	linux-input, x86


[-- Attachment #1.1: Type: text/plain, Size: 2304 bytes --]

From c78a0572f5ec2b927f9b723af687e6ef913561a4 Mon Sep 17 00:00:00 2001
From: Eddie Hudgins <Oochiolio@gmail.com>
Date: Tue, 10 Mar 2026 21:53:07 -0500
Subject: [PATCH] Signed-off-by: Eddie Hudgins <Oochiolio@gmail.com>
 arch/x86/tools: Removed headers in relocs_32.c scripts/basic: Removed
headers
 in fixdep.c drivers/pps: Removed headers in pps.c drivers/input: Removed
 headers in input-mt.c

These changes compile for x86, x86_64, and powerpc (Those were the only
ones fairly tested) under defconfig. This aims to clean up code and
simplify the files for developers. This will also contribute to start of
decluttering the environment.
---
 arch/x86/tools/relocs_32.c | 1 -
 drivers/input/input-mt.c   | 1 -
 drivers/pps/pps.c          | 3 ---
 scripts/basic/fixdep.c     | 1 -
 4 files changed, 6 deletions(-)

diff --git a/arch/x86/tools/relocs_32.c b/arch/x86/tools/relocs_32.c
index 9442ff78be83..9e4668e74993 100644
--- a/arch/x86/tools/relocs_32.c
+++ b/arch/x86/tools/relocs_32.c
@@ -1,6 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
 #include "relocs.h"
-
 #define ELF_BITS 32

 #define ELF_MACHINE            EM_386
diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c
index c06e98fbd77c..b553b7f2313a 100644
--- a/drivers/input/input-mt.c
+++ b/drivers/input/input-mt.c
@@ -7,7 +7,6 @@

 #include <linux/input/mt.h>
 #include <linux/export.h>
-#include <linux/slab.h>
 #include "input-core-private.h"

 #define TRKID_SGN      ((TRKID_MAX + 1) >> 1)
diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c
index c6b8b6478276..a9a8802c2399 100644
--- a/drivers/pps/pps.c
+++ b/drivers/pps/pps.c
@@ -7,14 +7,11 @@

 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

-#include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/sched.h>
 #include <linux/uaccess.h>
 #include <linux/idr.h>
 #include <linux/mutex.h>
-#include <linux/cdev.h>
 #include <linux/poll.h>
 #include <linux/pps_kernel.h>
 #include <linux/slab.h>
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index cdd5da7e009b..feb9e7d8984d 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -89,7 +89,6 @@
  *  but I don't think the added complexity is worth it)
  */

-#include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <fcntl.h>
--
2.43.0

[-- Attachment #1.2: Type: text/html, Size: 2829 bytes --]

[-- Attachment #2: 0001-Signed-off-by-Eddie-Hudgins-Oochiolio-gmail.com.patch --]
[-- Type: application/octet-stream, Size: 2297 bytes --]

From c78a0572f5ec2b927f9b723af687e6ef913561a4 Mon Sep 17 00:00:00 2001
From: Eddie Hudgins <Oochiolio@gmail.com>
Date: Tue, 10 Mar 2026 21:53:07 -0500
Subject: [PATCH] Signed-off-by: Eddie Hudgins <Oochiolio@gmail.com>
 arch/x86/tools: Removed headers in relocs_32.c scripts/basic: Removed headers
 in fixdep.c drivers/pps: Removed headers in pps.c drivers/input: Removed
 headers in input-mt.c

These changes compile for x86, x86_64, and powerpc (Those were the only ones fairly tested) under defconfig. This aims to clean up code and simplify the files for developers. This will also contribute to start of decluttering the environment.
---
 arch/x86/tools/relocs_32.c | 1 -
 drivers/input/input-mt.c   | 1 -
 drivers/pps/pps.c          | 3 ---
 scripts/basic/fixdep.c     | 1 -
 4 files changed, 6 deletions(-)

diff --git a/arch/x86/tools/relocs_32.c b/arch/x86/tools/relocs_32.c
index 9442ff78be83..9e4668e74993 100644
--- a/arch/x86/tools/relocs_32.c
+++ b/arch/x86/tools/relocs_32.c
@@ -1,6 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
 #include "relocs.h"
-
 #define ELF_BITS 32
 
 #define ELF_MACHINE		EM_386
diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c
index c06e98fbd77c..b553b7f2313a 100644
--- a/drivers/input/input-mt.c
+++ b/drivers/input/input-mt.c
@@ -7,7 +7,6 @@
 
 #include <linux/input/mt.h>
 #include <linux/export.h>
-#include <linux/slab.h>
 #include "input-core-private.h"
 
 #define TRKID_SGN	((TRKID_MAX + 1) >> 1)
diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c
index c6b8b6478276..a9a8802c2399 100644
--- a/drivers/pps/pps.c
+++ b/drivers/pps/pps.c
@@ -7,14 +7,11 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
-#include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/sched.h>
 #include <linux/uaccess.h>
 #include <linux/idr.h>
 #include <linux/mutex.h>
-#include <linux/cdev.h>
 #include <linux/poll.h>
 #include <linux/pps_kernel.h>
 #include <linux/slab.h>
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index cdd5da7e009b..feb9e7d8984d 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -89,7 +89,6 @@
  *  but I don't think the added complexity is worth it)
  */
 
-#include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <fcntl.h>
-- 
2.43.0


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

* Re: [PATCH] Remove unused headers in x86/tools, scripts, pps, input
  2026-03-11  3:01 [PATCH] Remove unused headers in x86/tools, scripts, pps, input Oli
@ 2026-03-18 19:56 ` Nicolas Schier
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Schier @ 2026-03-18 19:56 UTC (permalink / raw)
  To: Oli
  Cc: Thomas Gleixner, Ingo Molnar, Steven Rostedt, Mathieu Desnoyers,
	Masami Hiramatsu, Rodolfo Giometti, Henrik Rydberg,
	Dmitry Torokhov, Nathan Chancellor, linux-kernel,
	linux-trace-kernel, linux-kbuild, linux-input, x86

Hi Oli,

thanks for your contribution.  Some comments below:

On Tue, Mar 10, 2026 at 10:01:41PM -0500, Oli wrote:
> From c78a0572f5ec2b927f9b723af687e6ef913561a4 Mon Sep 17 00:00:00 2001
> From: Eddie Hudgins <Oochiolio@gmail.com>
> Date: Tue, 10 Mar 2026 21:53:07 -0500
> Subject: [PATCH] Signed-off-by: Eddie Hudgins <Oochiolio@gmail.com>
>  arch/x86/tools: Removed headers in relocs_32.c scripts/basic: Removed
> headers
>  in fixdep.c drivers/pps: Removed headers in pps.c drivers/input: Removed
>  headers in input-mt.c

Usually, patch mails do not contain mail headers within their body; the
only possible exception is 'From:' if the sender is not the patch
author.  These additional headers prevent the usual patch application
(e.g. 'git am <mail').

> 
> These changes compile for x86, x86_64, and powerpc (Those were the only
> ones fairly tested) under defconfig. This aims to clean up code and
> simplify the files for developers. This will also contribute to start of
> decluttering the environment.

A commit subject should start with a subsystem identifier.  A commit
message should tell about the what and why of the patch, followed by a
'Signed-of-by'.  E.g.:

   kbuild: fixdep: Remove unused includes

   Remove unused #include statements for clean up.

   Signed-off-by: Your Name <your.e.mail@addre.ss>

(More complex changes require more details commit message).

Please check Documentation/process/submitting-patches.rst.

[...]
> diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
> index cdd5da7e009b..feb9e7d8984d 100644
> --- a/scripts/basic/fixdep.c
> +++ b/scripts/basic/fixdep.c
> @@ -89,7 +89,6 @@
>   *  but I don't think the added complexity is worth it)
>   */
> 
> -#include <sys/types.h>
>  #include <sys/stat.h>
>  #include <unistd.h>
>  #include <fcntl.h>
> --
> 2.43.0

The change in scripts/basic/fixdep.c looks good to me.  Do you want to
prepare a new kbuild-only patch and want me to take it for kbuild?

Kind regards,
Nicolas

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

end of thread, other threads:[~2026-03-18 19:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-11  3:01 [PATCH] Remove unused headers in x86/tools, scripts, pps, input Oli
2026-03-18 19:56 ` Nicolas Schier

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