[PATCH 4/4] treewide: drop last remnants of <config.h>

Ahmad Fatoum a.fatoum at pengutronix.de
Fri Nov 28 02:58:44 PST 2025


From: Ahmad Fatoum <a.fatoum at barebox.org>

With all architectures migrated away from config.h use, let's remove
generation logic and remaining includes.

Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
---
 .../migration-guides/migration-master.rst     |  7 +++++++
 Makefile                                      | 19 ++-----------------
 common/console.c                              |  1 -
 common/console_simple.c                       |  1 -
 common/memsize.c                              |  1 -
 drivers/usb/gadget/function/dfu.c             |  1 -
 include/.gitignore                            |  3 ---
 include/common.h                              |  1 -
 lib/image-sparse.c                            |  1 -
 9 files changed, 9 insertions(+), 26 deletions(-)
 create mode 100644 Documentation/migration-guides/migration-master.rst
 delete mode 100644 include/.gitignore

diff --git a/Documentation/migration-guides/migration-master.rst b/Documentation/migration-guides/migration-master.rst
new file mode 100644
index 000000000000..bb9a24bc06ab
--- /dev/null
+++ b/Documentation/migration-guides/migration-master.rst
@@ -0,0 +1,7 @@
+<config.h> removal for PowerPC
+------------------------------
+
+PowerPC was the last remaining user of per-board ``<config.h>`` files.
+The alternative for out-of-tree boards is now to patch
+``arch/powerpc/include/asm/config.h`` to include the board's config.h,
+like the in-tree boards are already doing.
diff --git a/Makefile b/Makefile
index f958114480f9..4b35b9561059 100644
--- a/Makefile
+++ b/Makefile
@@ -1143,7 +1143,7 @@ scripts: scripts_basic scripts_dtc include/generated/utsrelease.h
 PHONY += prepare archprepare prepare0
 
 archprepare: outputmakefile scripts_basic include/config/kernel.release \
-	$(version_h) include/generated/utsrelease.h include/config.h \
+	$(version_h) include/generated/utsrelease.h \
 	include/generated/autoconf.h
 
 prepare0: archprepare FORCE
@@ -1161,21 +1161,6 @@ prepare: prepare0
 
 export CPPFLAGS_barebox.lds += -C -U$(SRCARCH)
 
-define symlink-config-h
-	if [ -f $(srctree)/$(BOARD)/config.h ]; then		\
-		$(kecho) '  SYMLINK $@ -> $(BOARD)/config.h';	\
-		ln -fsn $(srctree)/$(BOARD)/config.h $@;	\
-	else							\
-		[ -h $@ ] && rm -f $@;				\
-		$(kecho) '  CREATE  $@';			\
-		touch -a $@;					\
-	fi
-endef
-
-PHONY += include/config.h
-include/config.h:
-	$(Q)$(symlink-config-h)
-
 # Create $(FIRMWARE_DIR) from $(CONFIG_EXTRA_FIRMWARE_DIR) -- if it doesn't have a
 # leading /, it's relative to $(srctree).
 FIRMWARE_DIR := $(subst $(quote),,$(CONFIG_EXTRA_FIRMWARE_DIR))
@@ -1400,7 +1385,7 @@ CLEAN_FILES +=	scripts/bareboxenv-target scripts/kernel-install-target \
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config usr/include include/generated Documentation/commands
 MRPROPER_FILES += .config .config.old .security_config .version .old_version \
-                  include/config.h *.sconfig.old          \
+                  *.sconfig.old          \
 		  Module.symvers tags TAGS cscope*
 
 # clean - Delete most, but leave enough to build external modules
diff --git a/common/console.c b/common/console.c
index aa2013c51522..8a55fd1a1dc6 100644
--- a/common/console.c
+++ b/common/console.c
@@ -4,7 +4,6 @@
  * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio at tin.it
  */
 
-#include <config.h>
 #include <security/config.h>
 #include <common.h>
 #include <stdarg.h>
diff --git a/common/console_simple.c b/common/console_simple.c
index c5f554bbee9b..25fe6217448c 100644
--- a/common/console_simple.c
+++ b/common/console_simple.c
@@ -1,6 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0-only
 
-#include <config.h>
 #include <common.h>
 #include <fs.h>
 #include <errno.h>
diff --git a/common/memsize.c b/common/memsize.c
index de4d8df18afb..f2e720798eb1 100644
--- a/common/memsize.c
+++ b/common/memsize.c
@@ -5,7 +5,6 @@
  */
 
 #include <common.h>
-#include <config.h>
 #if defined (__PPC__) && !defined (__SANDBOX__)
 /*
  * At least on G2 PowerPC cores, sequential accesses to non-existent
diff --git a/drivers/usb/gadget/function/dfu.c b/drivers/usb/gadget/function/dfu.c
index 893dcc7f7007..4d7001e48d85 100644
--- a/drivers/usb/gadget/function/dfu.c
+++ b/drivers/usb/gadget/function/dfu.c
@@ -35,7 +35,6 @@
 #include <linux/err.h>
 #include <linux/usb/ch9.h>
 #include <linux/usb/dfu.h>
-#include <config.h>
 #include <common.h>
 #include <malloc.h>
 #include <errno.h>
diff --git a/include/.gitignore b/include/.gitignore
deleted file mode 100644
index 3ac630625dc7..000000000000
--- a/include/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-
-/config.h
diff --git a/include/common.h b/include/common.h
index 16a08fe293af..96670ca3abee 100644
--- a/include/common.h
+++ b/include/common.h
@@ -10,7 +10,6 @@
 #include <stdio.h>
 #include <barebox.h>
 #include <module.h>
-#include <config.h>
 #include <clock.h>
 #include <linux/bitops.h>
 #include <linux/types.h>
diff --git a/lib/image-sparse.c b/lib/image-sparse.c
index eb5242e25ada..67f3b4b11dc3 100644
--- a/lib/image-sparse.c
+++ b/lib/image-sparse.c
@@ -35,7 +35,6 @@
  */
 #define pr_fmt(fmt)  "image-sparse: " fmt
 
-#include <config.h>
 #include <common.h>
 #include <image-sparse.h>
 #include <unistd.h>
-- 
2.47.3




More information about the barebox mailing list