mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 4/4] treewide: drop last remnants of <config.h>
Date: Fri, 28 Nov 2025 11:58:44 +0100	[thread overview]
Message-ID: <20251128110005.3336591-5-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20251128110005.3336591-1-a.fatoum@pengutronix.de>

From: Ahmad Fatoum <a.fatoum@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@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@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




  parent reply	other threads:[~2025-11-28 11:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-28 10:58 [PATCH 0/4] Kbuild: replace legacy <config.h> mechanism Ahmad Fatoum
2025-11-28 10:58 ` [PATCH 1/4] openrisc: drop <config.h> usage Ahmad Fatoum
2025-12-01 10:11   ` Sascha Hauer
2025-11-28 10:58 ` [PATCH 2/4] ARM: " Ahmad Fatoum
2025-11-28 10:58 ` [PATCH 3/4] ppc: " Ahmad Fatoum
2025-11-28 10:58 ` Ahmad Fatoum [this message]
2025-12-01 10:11 ` [PATCH 0/4] Kbuild: replace legacy <config.h> mechanism Sascha Hauer

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=20251128110005.3336591-5-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.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