* [PATCH 1/5] global: Add <linux/string.h> instead of long indirect include path
2025-05-14 22:45 [PATCH 0/5] Start removing <env.h> from headers when not required Tom Rini
@ 2025-05-14 22:46 ` Tom Rini
2025-05-14 22:46 ` [PATCH 2/5] cmd/mem.c, test/cmd/mem_copy.c: Add <compiler.h> Tom Rini
` (5 subsequent siblings)
6 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-14 22:46 UTC (permalink / raw)
To: u-boot
Cc: Andrew Davis, Bin Meng, Dai Okamura, Fabio Estevam,
Francesco Dolcini, Ilias Apalodimas, Jens Wiklander,
Kunihiko Hayashi, Mingkai Hu, Priyanka Jain, Shengzhou Liu,
Simon Glass, Stefano Babic, Svyatoslav Ryhel, Thierry Reding,
William Zhang
In a number of cases we have C files which rely on a chain of indirect
include paths to get <linux/string.h> to be included via <command.h>. To
facilitate cleaning up <command.h> make this code directly include
<linux/string.h>.
Signed-off-by: Tom Rini <trini@konsulko.com>
---
Cc: Andrew Davis <afd@ti.com>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Dai Okamura <okamura.dai@socionext.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Francesco Dolcini <francesco.dolcini@toradex.com>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Jens Wiklander <jens.wiklander@linaro.org>
Cc: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Cc: Mingkai Hu <mingkai.hu@nxp.com>
Cc: Priyanka Jain <priyanka.jain@nxp.com>
Cc: Shengzhou Liu <Shengzhou.Liu@nxp.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefano Babic <sbabic@nabladev.com>
Cc: Svyatoslav Ryhel <clamor95@gmail.com>
Cc: Thierry Reding <treding@nvidia.com>
Cc: William Zhang <william.zhang@broadcom.com>
---
arch/arm/mach-imx/mx5/clock.c | 1 +
arch/arm/mach-keystone/cmd_clock.c | 1 +
arch/arm/mach-tegra/tegra124/bct.c | 1 +
arch/arm/mach-tegra/tegra20/bct.c | 1 +
arch/arm/mach-tegra/tegra30/bct.c | 1 +
arch/arm/mach-uniphier/dram/cmd_ddrmphy.c | 1 +
arch/arm/mach-uniphier/dram/cmd_ddrphy.c | 1 +
board/freescale/common/qixis.c | 1 +
board/freescale/ls1043ardb/cpld.c | 1 +
board/freescale/ls1046ardb/cpld.c | 1 +
board/freescale/p2041rdb/cpld.c | 1 +
board/freescale/t102xrdb/cpld.c | 1 +
board/freescale/t104xrdb/cpld.c | 1 +
board/freescale/t208xrdb/cpld.c | 1 +
board/freescale/t4rdb/cpld.c | 1 +
board/toradex/apalis_imx6/do_fuse.c | 1 +
board/toradex/colibri_imx6/do_fuse.c | 1 +
boot/image-pre-load.c | 1 +
cmd/2048.c | 1 +
cmd/armflash.c | 1 +
cmd/bootstage.c | 1 +
cmd/cache.c | 1 +
cmd/diag.c | 1 +
cmd/dm.c | 1 +
cmd/echo.c | 1 +
cmd/flash.c | 1 +
cmd/fuse.c | 1 +
cmd/irq.c | 1 +
cmd/legacy_led.c | 1 +
cmd/mp.c | 1 +
cmd/optee.c | 1 +
cmd/sha1sum.c | 1 +
cmd/sleep.c | 1 +
cmd/smccc.c | 1 +
cmd/stackprot_test.c | 1 +
cmd/strings.c | 1 +
cmd/test.c | 1 +
cmd/timer.c | 1 +
cmd/ufs.c | 1 +
cmd/x86/mtrr.c | 1 +
drivers/tpm/sandbox_common.c | 1 +
41 files changed, 41 insertions(+)
diff --git a/arch/arm/mach-imx/mx5/clock.c b/arch/arm/mach-imx/mx5/clock.c
index 41116e2c6a2c..9901f8a7b56f 100644
--- a/arch/arm/mach-imx/mx5/clock.c
+++ b/arch/arm/mach-imx/mx5/clock.c
@@ -10,6 +10,7 @@
#include <log.h>
#include <asm/io.h>
#include <linux/errno.h>
+#include <linux/string.h>
#include <asm/arch/imx-regs.h>
#include <asm/arch/crm_regs.h>
#include <asm/arch/clock.h>
diff --git a/arch/arm/mach-keystone/cmd_clock.c b/arch/arm/mach-keystone/cmd_clock.c
index e9ecc05953a8..7b94a80b725e 100644
--- a/arch/arm/mach-keystone/cmd_clock.c
+++ b/arch/arm/mach-keystone/cmd_clock.c
@@ -8,6 +8,7 @@
#include <vsprintf.h>
#include <command.h>
+#include <linux/string.h>
#include <asm/arch/hardware.h>
#include <asm/arch/clock.h>
#include <asm/arch/psc_defs.h>
diff --git a/arch/arm/mach-tegra/tegra124/bct.c b/arch/arm/mach-tegra/tegra124/bct.c
index a71aa87fce12..4dc4b7138ab8 100644
--- a/arch/arm/mach-tegra/tegra124/bct.c
+++ b/arch/arm/mach-tegra/tegra124/bct.c
@@ -7,6 +7,7 @@
#include <command.h>
#include <log.h>
#include <vsprintf.h>
+#include <linux/string.h>
#include <asm/arch-tegra/crypto.h>
#include "bct.h"
#include "uboot_aes.h"
diff --git a/arch/arm/mach-tegra/tegra20/bct.c b/arch/arm/mach-tegra/tegra20/bct.c
index b647b6b26d2a..253cb2436761 100644
--- a/arch/arm/mach-tegra/tegra20/bct.c
+++ b/arch/arm/mach-tegra/tegra20/bct.c
@@ -7,6 +7,7 @@
#include <command.h>
#include <log.h>
#include <vsprintf.h>
+#include <linux/string.h>
#include <asm/arch-tegra/crypto.h>
#include "bct.h"
#include "uboot_aes.h"
diff --git a/arch/arm/mach-tegra/tegra30/bct.c b/arch/arm/mach-tegra/tegra30/bct.c
index 250009ea8d8e..398ba1de3869 100644
--- a/arch/arm/mach-tegra/tegra30/bct.c
+++ b/arch/arm/mach-tegra/tegra30/bct.c
@@ -7,6 +7,7 @@
#include <command.h>
#include <log.h>
#include <vsprintf.h>
+#include <linux/string.h>
#include <asm/arch-tegra/crypto.h>
#include "bct.h"
#include "uboot_aes.h"
diff --git a/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c b/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c
index 629f8b90c9d8..be4ce3265bb8 100644
--- a/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c
+++ b/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c
@@ -9,6 +9,7 @@
#include <linux/io.h>
#include <linux/printk.h>
#include <linux/sizes.h>
+#include <linux/string.h>
#include "../soc-info.h"
#include "ddrmphy-regs.h"
diff --git a/arch/arm/mach-uniphier/dram/cmd_ddrphy.c b/arch/arm/mach-uniphier/dram/cmd_ddrphy.c
index ca519d1c7e0c..3ccafe206382 100644
--- a/arch/arm/mach-uniphier/dram/cmd_ddrphy.c
+++ b/arch/arm/mach-uniphier/dram/cmd_ddrphy.c
@@ -10,6 +10,7 @@
#include <linux/io.h>
#include <linux/printk.h>
#include <linux/sizes.h>
+#include <linux/string.h>
#include "../soc-info.h"
#include "ddrphy-regs.h"
diff --git a/board/freescale/common/qixis.c b/board/freescale/common/qixis.c
index 7815ba2dbce9..04cad48f033a 100644
--- a/board/freescale/common/qixis.c
+++ b/board/freescale/common/qixis.c
@@ -12,6 +12,7 @@
#include <asm/io.h>
#include <linux/compiler.h>
#include <linux/time.h>
+#include <linux/string.h>
#include <i2c.h>
#include "qixis.h"
diff --git a/board/freescale/ls1043ardb/cpld.c b/board/freescale/ls1043ardb/cpld.c
index bda2f3ac3a69..39b6c6449cf7 100644
--- a/board/freescale/ls1043ardb/cpld.c
+++ b/board/freescale/ls1043ardb/cpld.c
@@ -7,6 +7,7 @@
#include <config.h>
#include <command.h>
+#include <linux/string.h>
#include <asm/io.h>
#include "cpld.h"
diff --git a/board/freescale/ls1046ardb/cpld.c b/board/freescale/ls1046ardb/cpld.c
index 7f8ca2e857fd..26a5962bd6ee 100644
--- a/board/freescale/ls1046ardb/cpld.c
+++ b/board/freescale/ls1046ardb/cpld.c
@@ -7,6 +7,7 @@
#include <config.h>
#include <command.h>
+#include <linux/string.h>
#include <asm/io.h>
#include "cpld.h"
diff --git a/board/freescale/p2041rdb/cpld.c b/board/freescale/p2041rdb/cpld.c
index 915a8b994d5c..2bba377d4d45 100644
--- a/board/freescale/p2041rdb/cpld.c
+++ b/board/freescale/p2041rdb/cpld.c
@@ -12,6 +12,7 @@
*/
#include <command.h>
+#include <linux/string.h>
#include <asm/io.h>
#include "cpld.h"
diff --git a/board/freescale/t102xrdb/cpld.c b/board/freescale/t102xrdb/cpld.c
index cc933ccd5440..00ea9d8f5038 100644
--- a/board/freescale/t102xrdb/cpld.c
+++ b/board/freescale/t102xrdb/cpld.c
@@ -9,6 +9,7 @@
#include <config.h>
#include <command.h>
+#include <linux/string.h>
#include <asm/io.h>
#include "cpld.h"
diff --git a/board/freescale/t104xrdb/cpld.c b/board/freescale/t104xrdb/cpld.c
index c2d526ae15ac..038e40e2faef 100644
--- a/board/freescale/t104xrdb/cpld.c
+++ b/board/freescale/t104xrdb/cpld.c
@@ -12,6 +12,7 @@
#include <config.h>
#include <command.h>
+#include <linux/string.h>
#include <asm/io.h>
#include "cpld.h"
diff --git a/board/freescale/t208xrdb/cpld.c b/board/freescale/t208xrdb/cpld.c
index d2226af62786..838d88d977e5 100644
--- a/board/freescale/t208xrdb/cpld.c
+++ b/board/freescale/t208xrdb/cpld.c
@@ -7,6 +7,7 @@
#include <config.h>
#include <command.h>
+#include <linux/string.h>
#include <asm/io.h>
#include "cpld.h"
diff --git a/board/freescale/t4rdb/cpld.c b/board/freescale/t4rdb/cpld.c
index f076350c1c55..258581eee960 100644
--- a/board/freescale/t4rdb/cpld.c
+++ b/board/freescale/t4rdb/cpld.c
@@ -16,6 +16,7 @@
#include <config.h>
#include <command.h>
+#include <linux/string.h>
#include <asm/io.h>
#include "cpld.h"
diff --git a/board/toradex/apalis_imx6/do_fuse.c b/board/toradex/apalis_imx6/do_fuse.c
index 698b05bc5ad5..8721276bed83 100644
--- a/board/toradex/apalis_imx6/do_fuse.c
+++ b/board/toradex/apalis_imx6/do_fuse.c
@@ -11,6 +11,7 @@
#include <command.h>
#include <console.h>
#include <fuse.h>
+#include <linux/string.h>
static int mfgr_fuse(void)
{
diff --git a/board/toradex/colibri_imx6/do_fuse.c b/board/toradex/colibri_imx6/do_fuse.c
index 698b05bc5ad5..8721276bed83 100644
--- a/board/toradex/colibri_imx6/do_fuse.c
+++ b/board/toradex/colibri_imx6/do_fuse.c
@@ -11,6 +11,7 @@
#include <command.h>
#include <console.h>
#include <fuse.h>
+#include <linux/string.h>
static int mfgr_fuse(void)
{
diff --git a/boot/image-pre-load.c b/boot/image-pre-load.c
index adf3b341a203..2f851ebb28c2 100644
--- a/boot/image-pre-load.c
+++ b/boot/image-pre-load.c
@@ -7,6 +7,7 @@
#include "mkimage.h"
#else
#include <asm/global_data.h>
+#include <env.h>
#include <mapmem.h>
DECLARE_GLOBAL_DATA_PTR;
#endif /* !USE_HOSTCC*/
diff --git a/cmd/2048.c b/cmd/2048.c
index 42cd171b0e41..aa0f82721dc1 100644
--- a/cmd/2048.c
+++ b/cmd/2048.c
@@ -8,6 +8,7 @@
#include <rand.h>
#include <vsprintf.h>
#include <linux/delay.h>
+#include <linux/string.h>
#define SIZE 4
static uint score;
diff --git a/cmd/armflash.c b/cmd/armflash.c
index e292cf85c45d..83f616db4efb 100644
--- a/cmd/armflash.c
+++ b/cmd/armflash.c
@@ -9,6 +9,7 @@
#include <console.h>
#include <flash.h>
#include <vsprintf.h>
+#include <linux/string.h>
#include <asm/io.h>
#define MAX_REGIONS 4
diff --git a/cmd/bootstage.c b/cmd/bootstage.c
index 8248c41ca826..5c6d5a3ab453 100644
--- a/cmd/bootstage.c
+++ b/cmd/bootstage.c
@@ -6,6 +6,7 @@
#include <bootstage.h>
#include <command.h>
#include <vsprintf.h>
+#include <linux/string.h>
static int do_bootstage_report(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
diff --git a/cmd/cache.c b/cmd/cache.c
index 3049f5c305f2..b7007877ab03 100644
--- a/cmd/cache.c
+++ b/cmd/cache.c
@@ -10,6 +10,7 @@
#include <command.h>
#include <cpu_func.h>
#include <linux/compiler.h>
+#include <linux/string.h>
static int parse_argv(const char *);
diff --git a/cmd/diag.c b/cmd/diag.c
index c6da5aae3fcd..4a88ab00a074 100644
--- a/cmd/diag.c
+++ b/cmd/diag.c
@@ -9,6 +9,7 @@
*/
#include <command.h>
#include <post.h>
+#include <linux/string.h>
int do_diag(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
diff --git a/cmd/dm.c b/cmd/dm.c
index ec9cfd85376e..1f212c0f0309 100644
--- a/cmd/dm.c
+++ b/cmd/dm.c
@@ -9,6 +9,7 @@
#include <command.h>
#include <dm/root.h>
#include <dm/util.h>
+#include <linux/string.h>
static int do_dm_dump_driver_compat(struct cmd_tbl *cmdtp, int flag, int argc,
char * const argv[])
diff --git a/cmd/echo.c b/cmd/echo.c
index 973213a03a66..d1346504cfb5 100644
--- a/cmd/echo.c
+++ b/cmd/echo.c
@@ -5,6 +5,7 @@
*/
#include <command.h>
+#include <linux/string.h>
static int do_echo(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
diff --git a/cmd/flash.c b/cmd/flash.c
index fd660ec477c9..76aa387ba596 100644
--- a/cmd/flash.c
+++ b/cmd/flash.c
@@ -10,6 +10,7 @@
#include <command.h>
#include <log.h>
#include <vsprintf.h>
+#include <linux/string.h>
#include <u-boot/uuid.h>
#if defined(CONFIG_CMD_MTDPARTS)
diff --git a/cmd/fuse.c b/cmd/fuse.c
index 6c42c0968093..e2206cdf0d54 100644
--- a/cmd/fuse.c
+++ b/cmd/fuse.c
@@ -14,6 +14,7 @@
#include <mapmem.h>
#include <vsprintf.h>
#include <linux/errno.h>
+#include <linux/string.h>
static int confirm_prog(void)
{
diff --git a/cmd/irq.c b/cmd/irq.c
index da223b4b2cce..58483d04de82 100644
--- a/cmd/irq.c
+++ b/cmd/irq.c
@@ -6,6 +6,7 @@
#include <config.h>
#include <command.h>
#include <irq_func.h>
+#include <linux/string.h>
static int do_interrupts(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
diff --git a/cmd/legacy_led.c b/cmd/legacy_led.c
index 50de7e89d8f4..db312ae6e2dd 100644
--- a/cmd/legacy_led.c
+++ b/cmd/legacy_led.c
@@ -12,6 +12,7 @@
#include <command.h>
#include <status_led.h>
#include <vsprintf.h>
+#include <linux/string.h>
struct led_tbl_s {
char *string; /* String for use in the command */
diff --git a/cmd/mp.c b/cmd/mp.c
index 261bb8a07d43..686e1f8a82fc 100644
--- a/cmd/mp.c
+++ b/cmd/mp.c
@@ -6,6 +6,7 @@
#include <command.h>
#include <cpu_func.h>
#include <vsprintf.h>
+#include <linux/string.h>
static int cpu_status_all(void)
{
diff --git a/cmd/optee.c b/cmd/optee.c
index e3aae5e9f9bf..155c9f1bb732 100644
--- a/cmd/optee.c
+++ b/cmd/optee.c
@@ -6,6 +6,7 @@
#include <errno.h>
#include <tee.h>
#include <vsprintf.h>
+#include <linux/string.h>
#define TA_HELLO_WORLD_CMD_INC_VALUE 0
/* This needs to match the UUID of the Hello World TA. */
diff --git a/cmd/sha1sum.c b/cmd/sha1sum.c
index 52aa26c78d2f..f2757146bbaf 100644
--- a/cmd/sha1sum.c
+++ b/cmd/sha1sum.c
@@ -9,6 +9,7 @@
#include <command.h>
#include <hash.h>
+#include <linux/string.h>
#include <u-boot/sha1.h>
int do_sha1sum(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
diff --git a/cmd/sleep.c b/cmd/sleep.c
index 7616fed75566..a8c896e0c5ee 100644
--- a/cmd/sleep.c
+++ b/cmd/sleep.c
@@ -9,6 +9,7 @@
#include <time.h>
#include <vsprintf.h>
#include <linux/delay.h>
+#include <linux/string.h>
static int do_sleep(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
diff --git a/cmd/smccc.c b/cmd/smccc.c
index 3a4d885e37e1..fa04bb05ca42 100644
--- a/cmd/smccc.c
+++ b/cmd/smccc.c
@@ -9,6 +9,7 @@
#include <linux/arm-smccc.h>
#include <linux/compiler.h>
#include <linux/psci.h>
+#include <linux/string.h>
static int do_call(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
diff --git a/cmd/stackprot_test.c b/cmd/stackprot_test.c
index e7ff4a061589..78e9beba5bf3 100644
--- a/cmd/stackprot_test.c
+++ b/cmd/stackprot_test.c
@@ -4,6 +4,7 @@
*/
#include <command.h>
+#include <linux/string.h>
static int do_test_stackprot_fail(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
diff --git a/cmd/strings.c b/cmd/strings.c
index 5bcb0f2b567c..beac2a6e6b3a 100644
--- a/cmd/strings.c
+++ b/cmd/strings.c
@@ -9,6 +9,7 @@
#include <config.h>
#include <command.h>
#include <vsprintf.h>
+#include <linux/string.h>
static char *start_addr, *last_addr;
diff --git a/cmd/test.c b/cmd/test.c
index b4c3eabf9f60..4774d2964874 100644
--- a/cmd/test.c
+++ b/cmd/test.c
@@ -8,6 +8,7 @@
#include <fs.h>
#include <log.h>
#include <vsprintf.h>
+#include <linux/string.h>
#define OP_INVALID 0
#define OP_NOT 1
diff --git a/cmd/timer.c b/cmd/timer.c
index 04fcd84ac6a6..427309e108df 100644
--- a/cmd/timer.c
+++ b/cmd/timer.c
@@ -6,6 +6,7 @@
#include <command.h>
#include <time.h>
+#include <linux/string.h>
static int do_timer(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
diff --git a/cmd/ufs.c b/cmd/ufs.c
index 6e21fbb1685c..790dab50f183 100644
--- a/cmd/ufs.c
+++ b/cmd/ufs.c
@@ -8,6 +8,7 @@
#include <command.h>
#include <ufs.h>
#include <vsprintf.h>
+#include <linux/string.h>
static int do_ufs(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
diff --git a/cmd/x86/mtrr.c b/cmd/x86/mtrr.c
index 289865515ef5..91130453039d 100644
--- a/cmd/x86/mtrr.c
+++ b/cmd/x86/mtrr.c
@@ -6,6 +6,7 @@
#include <command.h>
#include <log.h>
#include <vsprintf.h>
+#include <linux/string.h>
#include <asm/msr.h>
#include <asm/mp.h>
#include <asm/mtrr.h>
diff --git a/drivers/tpm/sandbox_common.c b/drivers/tpm/sandbox_common.c
index 596e01563899..9d386fc32e5a 100644
--- a/drivers/tpm/sandbox_common.c
+++ b/drivers/tpm/sandbox_common.c
@@ -9,6 +9,7 @@
#include <tpm-v1.h>
#include <tpm-v2.h>
+#include <linux/string.h>
#include <asm/unaligned.h>
#include "sandbox_common.h"
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 2/5] cmd/mem.c, test/cmd/mem_copy.c: Add <compiler.h>
2025-05-14 22:45 [PATCH 0/5] Start removing <env.h> from headers when not required Tom Rini
2025-05-14 22:46 ` [PATCH 1/5] global: Add <linux/string.h> instead of long indirect include path Tom Rini
@ 2025-05-14 22:46 ` Tom Rini
2025-05-14 22:46 ` [PATCH 3/5] gpio: pca953x: Add missing <asm/byteorder.h> Tom Rini
` (4 subsequent siblings)
6 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-14 22:46 UTC (permalink / raw)
To: u-boot
These files require <compiler.h> in order to have MEM_SUPPORT_64BIT_DATA
be defined but currently rely on a long indirect include path to get it.
Add this directly.
Signed-off-by: Tom Rini <trini@konsulko.com>
---
cmd/mem.c | 1 +
test/cmd/mem_copy.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/cmd/mem.c b/cmd/mem.c
index 9e716776393a..e5b9cb293491 100644
--- a/cmd/mem.c
+++ b/cmd/mem.c
@@ -14,6 +14,7 @@
#include <bootretry.h>
#include <cli.h>
#include <command.h>
+#include <compiler.h>
#include <console.h>
#include <display_options.h>
#ifdef CONFIG_MTD_NOR_FLASH
diff --git a/test/cmd/mem_copy.c b/test/cmd/mem_copy.c
index 3e904fc4e4ba..8e551f18a852 100644
--- a/test/cmd/mem_copy.c
+++ b/test/cmd/mem_copy.c
@@ -4,6 +4,7 @@
*/
#include <command.h>
+#include <compiler.h>
#include <console.h>
#include <mapmem.h>
#include <dm/test.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 3/5] gpio: pca953x: Add missing <asm/byteorder.h>
2025-05-14 22:45 [PATCH 0/5] Start removing <env.h> from headers when not required Tom Rini
2025-05-14 22:46 ` [PATCH 1/5] global: Add <linux/string.h> instead of long indirect include path Tom Rini
2025-05-14 22:46 ` [PATCH 2/5] cmd/mem.c, test/cmd/mem_copy.c: Add <compiler.h> Tom Rini
@ 2025-05-14 22:46 ` Tom Rini
2025-05-14 22:46 ` [PATCH 4/5] global: Avoid indirect inclusion of <env.h> from <command.h> Tom Rini
` (3 subsequent siblings)
6 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-14 22:46 UTC (permalink / raw)
To: u-boot
This driver takes a long implicit include path to get this header which
it directly uses. Add it.
Signed-off-by: Tom Rini <trini@konsulko.com>
---
drivers/gpio/pca953x.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpio/pca953x.c b/drivers/gpio/pca953x.c
index 2fb14590c0fe..f0a79b92b024 100644
--- a/drivers/gpio/pca953x.c
+++ b/drivers/gpio/pca953x.c
@@ -13,6 +13,7 @@
#include <i2c.h>
#include <pca953x.h>
#include <vsprintf.h>
+#include <asm/byteorder.h>
/* Default to an address that hopefully won't corrupt other i2c devices */
#ifndef CFG_SYS_I2C_PCA953X_ADDR
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 4/5] global: Avoid indirect inclusion of <env.h> from <command.h>
2025-05-14 22:45 [PATCH 0/5] Start removing <env.h> from headers when not required Tom Rini
` (2 preceding siblings ...)
2025-05-14 22:46 ` [PATCH 3/5] gpio: pca953x: Add missing <asm/byteorder.h> Tom Rini
@ 2025-05-14 22:46 ` Tom Rini
2025-05-15 8:01 ` Mattijs Korpershoek
2025-05-15 11:52 ` Jerome Forissier
2025-05-14 22:46 ` [PATCH 5/5] include/command.h: Drop <env.h> Tom Rini
` (2 subsequent siblings)
6 siblings, 2 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-14 22:46 UTC (permalink / raw)
To: u-boot
Cc: Anatolij Gustschin, Bin Meng, Heinrich Schuchardt,
Ilias Apalodimas, Jaehoon Chung, Jerome Forissier, Linus Walleij,
Lukasz Majewski, Marek Vasut, Mark Kettenis, Masahisa Kojima,
Mattijs Korpershoek, Patrice Chotard, Patrick Delaunay,
Rayagonda Kokatanur, Simon Glass, Simon Goldschmidt, Stefan Bosch,
Tien Fong Chee, Tingting Meng, Tobias Waldekranz
The include file <command.h> does not need anything from <env.h>.
Furthermore, include/env.h itself includes other headers which can lead
to longer indirect inclusion paths. To prepare to remove <env.h> from
<command.h> fix all of the places which had relied on this indirect
inclusion to instead include <env.h> directly.
Signed-off-by: Tom Rini <trini@konsulko.com>
---
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Jerome Forissier <jerome.forissier@linaro.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Mark Kettenis <kettenis@openbsd.org>
Cc: Masahisa Kojima <kojima.masahisa@socionext.com>
Cc: Mattijs Korpershoek <mkorpershoek@kernel.org>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Stefan Bosch <stefan_b@posteo.net>
Cc: Tien Fong Chee <tien.fong.chee@altera.com>
Cc: Tingting Meng <tingting.meng@altera.com>
Cc: Tobias Waldekranz <tobias@waldekranz.com>
---
arch/arm/cpu/armv8/fsl-layerscape/fdt.c | 1 +
arch/arm/mach-apple/board.c | 1 +
arch/arm/mach-k3/r5/common.c | 1 +
arch/arm/mach-socfpga/board.c | 1 +
arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c | 1 +
board/liebherr/mccmon6/spl.c | 1 +
board/siemens/common/board_am335x.c | 1 +
board/socionext/developerbox/fwu_plat.c | 1 +
boot/bootmeth_android.c | 1 +
cmd/abootimg.c | 1 +
cmd/adc.c | 1 +
cmd/armflash.c | 1 +
cmd/bcb.c | 1 +
cmd/blkmap.c | 1 +
cmd/bootflow.c | 1 +
cmd/booti.c | 1 +
cmd/bootmeth.c | 1 +
cmd/broadcom/nitro_image_load.c | 1 +
cmd/extension_board.c | 1 +
cmd/hash.c | 1 +
cmd/mbr.c | 1 +
cmd/mem.c | 1 +
cmd/mmc.c | 1 +
cmd/sandbox/exception.c | 1 +
cmd/seama.c | 1 +
cmd/spawn.c | 1 +
cmd/upl.c | 1 +
cmd/x86/zboot.c | 1 +
common/usb.c | 1 +
drivers/power/axp221.c | 1 +
drivers/video/nexell_display.c | 1 +
lib/efi_loader/efi_firmware.c | 1 +
test/boot/bootdev.c | 1 +
test/boot/bootflow.c | 1 +
test/boot/bootm.c | 1 +
test/boot/bootmeth.c | 1 +
test/boot/measurement.c | 1 +
test/boot/upl.c | 1 +
test/cmd/fdt.c | 1 +
test/cmd/hash.c | 1 +
test/cmd/mem_search.c | 1 +
test/cmd/setexpr.c | 1 +
test/common/test_autoboot.c | 1 +
test/dm/blkmap.c | 1 +
test/dm/button.c | 1 +
test/dm/fastboot.c | 1 +
test/dm/part.c | 1 +
test/env/fdt.c | 1 +
test/hush/dollar.c | 1 +
test/hush/if.c | 1 +
test/hush/loop.c | 1 +
51 files changed, 51 insertions(+)
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
index ca6be3626fbe..e8d2339f1a3b 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
@@ -7,6 +7,7 @@
#include <config.h>
#include <clock_legacy.h>
#include <efi_loader.h>
+#include <env.h>
#include <log.h>
#include <asm/cache.h>
#include <linux/libfdt.h>
diff --git a/arch/arm/mach-apple/board.c b/arch/arm/mach-apple/board.c
index 2644a04a6228..2604c5a710ef 100644
--- a/arch/arm/mach-apple/board.c
+++ b/arch/arm/mach-apple/board.c
@@ -6,6 +6,7 @@
#include <dm.h>
#include <dm/uclass-internal.h>
#include <efi_loader.h>
+#include <env.h>
#include <lmb.h>
#include <asm/armv8/mmu.h>
diff --git a/arch/arm/mach-k3/r5/common.c b/arch/arm/mach-k3/r5/common.c
index 0b6604039f3e..fa146549f137 100644
--- a/arch/arm/mach-k3/r5/common.c
+++ b/arch/arm/mach-k3/r5/common.c
@@ -5,6 +5,7 @@
* Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/
*/
+#include <env.h>
#include <linux/printk.h>
#include <linux/types.h>
#include <asm/hardware.h>
diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach-socfpga/board.c
index 8506d5104134..bda123248033 100644
--- a/arch/arm/mach-socfpga/board.c
+++ b/arch/arm/mach-socfpga/board.c
@@ -7,6 +7,7 @@
#include <config.h>
#include <errno.h>
+#include <env.h>
#include <fdtdec.h>
#include <log.h>
#include <init.h>
diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
index 04640e476e6b..506ecac2ef08 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
@@ -6,6 +6,7 @@
#include <bootm.h>
#include <command.h>
#include <dfu.h>
+#include <env.h>
#include <image.h>
#include <asm/arch/stm32prog.h>
#include <linux/printk.h>
diff --git a/board/liebherr/mccmon6/spl.c b/board/liebherr/mccmon6/spl.c
index b1f6881275d5..e612d9e9ce03 100644
--- a/board/liebherr/mccmon6/spl.c
+++ b/board/liebherr/mccmon6/spl.c
@@ -5,6 +5,7 @@
* Richard Hu <hakahu@gmail.com>
*/
+#include <env.h>
#include <image.h>
#include <init.h>
#include <asm/arch/clock.h>
diff --git a/board/siemens/common/board_am335x.c b/board/siemens/common/board_am335x.c
index daf0bb930ec0..939ff81797dd 100644
--- a/board/siemens/common/board_am335x.c
+++ b/board/siemens/common/board_am335x.c
@@ -10,6 +10,7 @@
*/
#include <command.h>
+#include <env.h>
#include <serial.h>
#include <watchdog.h>
#include <asm/arch/clock.h>
diff --git a/board/socionext/developerbox/fwu_plat.c b/board/socionext/developerbox/fwu_plat.c
index a8b111477ef9..5d2f40f241ce 100644
--- a/board/socionext/developerbox/fwu_plat.c
+++ b/board/socionext/developerbox/fwu_plat.c
@@ -4,6 +4,7 @@
*/
#include <efi_loader.h>
+#include <env.h>
#include <fwu.h>
#include <fwu_mdata.h>
#include <memalign.h>
diff --git a/boot/bootmeth_android.c b/boot/bootmeth_android.c
index 654ebfdf1fcc..8c2bde10e171 100644
--- a/boot/bootmeth_android.c
+++ b/boot/bootmeth_android.c
@@ -18,6 +18,7 @@
#include <bootm.h>
#include <bootmeth.h>
#include <dm.h>
+#include <env.h>
#include <image.h>
#include <malloc.h>
#include <mapmem.h>
diff --git a/cmd/abootimg.c b/cmd/abootimg.c
index ae7a1a7c83b0..44de00fb9c97 100644
--- a/cmd/abootimg.c
+++ b/cmd/abootimg.c
@@ -6,6 +6,7 @@
#include <android_image.h>
#include <command.h>
+#include <env.h>
#include <image.h>
#include <mapmem.h>
diff --git a/cmd/adc.c b/cmd/adc.c
index 4d3b5b61f6f0..334ba7fdeca8 100644
--- a/cmd/adc.c
+++ b/cmd/adc.c
@@ -5,6 +5,7 @@
*/
#include <command.h>
#include <dm.h>
+#include <env.h>
#include <adc.h>
#include <linux/printk.h>
diff --git a/cmd/armflash.c b/cmd/armflash.c
index 83f616db4efb..cde275c881b1 100644
--- a/cmd/armflash.c
+++ b/cmd/armflash.c
@@ -7,6 +7,7 @@
*/
#include <command.h>
#include <console.h>
+#include <env.h>
#include <flash.h>
#include <vsprintf.h>
#include <linux/string.h>
diff --git a/cmd/bcb.c b/cmd/bcb.c
index 16eabfe00f5a..d6d944bd6b31 100644
--- a/cmd/bcb.c
+++ b/cmd/bcb.c
@@ -8,6 +8,7 @@
#include <android_bootloader_message.h>
#include <bcb.h>
#include <command.h>
+#include <env.h>
#include <android_ab.h>
#include <display_options.h>
#include <log.h>
diff --git a/cmd/blkmap.c b/cmd/blkmap.c
index 86a123b1cd37..65edec899e2c 100644
--- a/cmd/blkmap.c
+++ b/cmd/blkmap.c
@@ -7,6 +7,7 @@
#include <blk.h>
#include <blkmap.h>
#include <command.h>
+#include <env.h>
#include <malloc.h>
#include <dm/device.h>
diff --git a/cmd/bootflow.c b/cmd/bootflow.c
index a1fd59a69f47..d4f7d3361500 100644
--- a/cmd/bootflow.c
+++ b/cmd/bootflow.c
@@ -13,6 +13,7 @@
#include <command.h>
#include <console.h>
#include <dm.h>
+#include <env.h>
#include <mapmem.h>
/**
diff --git a/cmd/booti.c b/cmd/booti.c
index 1a57fe913977..7e6d94262993 100644
--- a/cmd/booti.c
+++ b/cmd/booti.c
@@ -6,6 +6,7 @@
#include <bootm.h>
#include <command.h>
+#include <env.h>
#include <image.h>
#include <irq_func.h>
#include <lmb.h>
diff --git a/cmd/bootmeth.c b/cmd/bootmeth.c
index 2f41fa1bec6b..ea4b3f47db8a 100644
--- a/cmd/bootmeth.c
+++ b/cmd/bootmeth.c
@@ -11,6 +11,7 @@
#include <bootstd.h>
#include <command.h>
#include <dm.h>
+#include <env.h>
#include <malloc.h>
#include <dm/uclass-internal.h>
diff --git a/cmd/broadcom/nitro_image_load.c b/cmd/broadcom/nitro_image_load.c
index 289b184e9afd..fe08679840ef 100644
--- a/cmd/broadcom/nitro_image_load.c
+++ b/cmd/broadcom/nitro_image_load.c
@@ -4,6 +4,7 @@
*/
#include <command.h>
+#include <env.h>
#include <vsprintf.h>
#define FW_IMAGE_SIG 0xff123456
diff --git a/cmd/extension_board.c b/cmd/extension_board.c
index 6c14d0ddebdc..317b260bf36a 100644
--- a/cmd/extension_board.c
+++ b/cmd/extension_board.c
@@ -7,6 +7,7 @@
#include <bootdev.h>
#include <command.h>
#include <dm.h>
+#include <env.h>
#include <malloc.h>
#include <extension_board.h>
#include <mapmem.h>
diff --git a/cmd/hash.c b/cmd/hash.c
index 5b40982b098d..96d0e443a5b6 100644
--- a/cmd/hash.c
+++ b/cmd/hash.c
@@ -10,6 +10,7 @@
*/
#include <command.h>
+#include <env.h>
#include <hash.h>
#include <linux/ctype.h>
diff --git a/cmd/mbr.c b/cmd/mbr.c
index 7e1f92a13bb5..7fe6c9e103ab 100644
--- a/cmd/mbr.c
+++ b/cmd/mbr.c
@@ -10,6 +10,7 @@
#include <blk.h>
#include <command.h>
+#include <env.h>
#include <malloc.h>
#include <part.h>
#include <vsprintf.h>
diff --git a/cmd/mem.c b/cmd/mem.c
index e5b9cb293491..b8afe62e4749 100644
--- a/cmd/mem.c
+++ b/cmd/mem.c
@@ -17,6 +17,7 @@
#include <compiler.h>
#include <console.h>
#include <display_options.h>
+#include <env.h>
#ifdef CONFIG_MTD_NOR_FLASH
#include <flash.h>
#endif
diff --git a/cmd/mmc.c b/cmd/mmc.c
index fe7899ec793c..5340a58be8ee 100644
--- a/cmd/mmc.c
+++ b/cmd/mmc.c
@@ -8,6 +8,7 @@
#include <command.h>
#include <console.h>
#include <display_options.h>
+#include <env.h>
#include <mapmem.h>
#include <memalign.h>
#include <mmc.h>
diff --git a/cmd/sandbox/exception.c b/cmd/sandbox/exception.c
index f9c847d8ff28..e015acf60e2b 100644
--- a/cmd/sandbox/exception.c
+++ b/cmd/sandbox/exception.c
@@ -6,6 +6,7 @@
*/
#include <command.h>
+#include <env.h>
static int do_sigsegv(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
diff --git a/cmd/seama.c b/cmd/seama.c
index 3c8e81992340..d62879780906 100644
--- a/cmd/seama.c
+++ b/cmd/seama.c
@@ -5,6 +5,7 @@
*/
#include <command.h>
+#include <env.h>
#include <nand.h>
/*
diff --git a/cmd/spawn.c b/cmd/spawn.c
index 37737b8627c8..8829aa9728d2 100644
--- a/cmd/spawn.c
+++ b/cmd/spawn.c
@@ -5,6 +5,7 @@
#include <command.h>
#include <console.h>
+#include <env.h>
#include <malloc.h>
#include <vsprintf.h>
#include <uthread.h>
diff --git a/cmd/upl.c b/cmd/upl.c
index c9a823bbc064..ef2183d85281 100644
--- a/cmd/upl.c
+++ b/cmd/upl.c
@@ -12,6 +12,7 @@
#include <alist.h>
#include <command.h>
#include <display_options.h>
+#include <env.h>
#include <mapmem.h>
#include <string.h>
#include <upl.h>
diff --git a/cmd/x86/zboot.c b/cmd/x86/zboot.c
index 94e602b8a5b6..3876d1632362 100644
--- a/cmd/x86/zboot.c
+++ b/cmd/x86/zboot.c
@@ -8,6 +8,7 @@
#define LOG_CATEGORY LOGC_BOOT
#include <command.h>
+#include <env.h>
#include <mapmem.h>
#include <vsprintf.h>
#include <asm/zimage.h>
diff --git a/common/usb.c b/common/usb.c
index 7a8435296c67..6a4ad346f4ba 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -28,6 +28,7 @@
#include <command.h>
#include <dm.h>
#include <dm/device_compat.h>
+#include <env.h>
#include <log.h>
#include <malloc.h>
#include <memalign.h>
diff --git a/drivers/power/axp221.c b/drivers/power/axp221.c
index c22ca03f4694..f5daa2430821 100644
--- a/drivers/power/axp221.c
+++ b/drivers/power/axp221.c
@@ -10,6 +10,7 @@
*/
#include <command.h>
+#include <env.h>
#include <errno.h>
#include <asm/arch/pmic_bus.h>
#include <axp_pmic.h>
diff --git a/drivers/video/nexell_display.c b/drivers/video/nexell_display.c
index 7bda33fb16e1..ea3776258a00 100644
--- a/drivers/video/nexell_display.c
+++ b/drivers/video/nexell_display.c
@@ -10,6 +10,7 @@
#include <config.h>
#include <command.h>
#include <dm.h>
+#include <env.h>
#include <mapmem.h>
#include <malloc.h>
#include <linux/compat.h>
diff --git a/lib/efi_loader/efi_firmware.c b/lib/efi_loader/efi_firmware.c
index d44dc09813e3..75501e215575 100644
--- a/lib/efi_loader/efi_firmware.c
+++ b/lib/efi_loader/efi_firmware.c
@@ -12,6 +12,7 @@
#include <dfu.h>
#include <efi_loader.h>
#include <efi_variable.h>
+#include <env.h>
#include <fwu.h>
#include <image.h>
#include <signatures.h>
diff --git a/test/boot/bootdev.c b/test/boot/bootdev.c
index 9af947868707..a5f3d4462a94 100644
--- a/test/boot/bootdev.c
+++ b/test/boot/bootdev.c
@@ -10,6 +10,7 @@
#include <dm.h>
#include <bootdev.h>
#include <bootflow.h>
+#include <env.h>
#include <mapmem.h>
#include <os.h>
#include <test/ut.h>
diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c
index b261bd5f620e..a930d2cc309a 100644
--- a/test/boot/bootflow.c
+++ b/test/boot/bootflow.c
@@ -14,6 +14,7 @@
#include <dm.h>
#include <efi.h>
#include <efi_loader.h>
+#include <env.h>
#include <expo.h>
#include <mapmem.h>
#ifdef CONFIG_SANDBOX
diff --git a/test/boot/bootm.c b/test/boot/bootm.c
index 1d1efe71ad52..ed60094f3c1a 100644
--- a/test/boot/bootm.c
+++ b/test/boot/bootm.c
@@ -6,6 +6,7 @@
*/
#include <bootm.h>
+#include <env.h>
#include <asm/global_data.h>
#include <test/test.h>
#include <test/ut.h>
diff --git a/test/boot/bootmeth.c b/test/boot/bootmeth.c
index 577f259fb371..2ef3569ad837 100644
--- a/test/boot/bootmeth.c
+++ b/test/boot/bootmeth.c
@@ -9,6 +9,7 @@
#include <bootmeth.h>
#include <bootstd.h>
#include <dm.h>
+#include <env.h>
#include <test/ut.h>
#include "bootstd_common.h"
diff --git a/test/boot/measurement.c b/test/boot/measurement.c
index 1d38663fc0f8..71f503f1567d 100644
--- a/test/boot/measurement.c
+++ b/test/boot/measurement.c
@@ -7,6 +7,7 @@
*/
#include <bootm.h>
+#include <env.h>
#include <malloc.h>
#include <test/test.h>
#include <test/ut.h>
diff --git a/test/boot/upl.c b/test/boot/upl.c
index eec89026fc30..e2dc3d51edaa 100644
--- a/test/boot/upl.c
+++ b/test/boot/upl.c
@@ -7,6 +7,7 @@
*/
#include <abuf.h>
+#include <env.h>
#include <mapmem.h>
#include <upl.h>
#include <dm/ofnode.h>
diff --git a/test/cmd/fdt.c b/test/cmd/fdt.c
index c11c181c807c..96a8488e1720 100644
--- a/test/cmd/fdt.c
+++ b/test/cmd/fdt.c
@@ -6,6 +6,7 @@
*/
#include <console.h>
+#include <env.h>
#include <fdt_support.h>
#include <mapmem.h>
#include <asm/global_data.h>
diff --git a/test/cmd/hash.c b/test/cmd/hash.c
index 296dd762b31d..bb96380c351a 100644
--- a/test/cmd/hash.c
+++ b/test/cmd/hash.c
@@ -6,6 +6,7 @@
*/
#include <command.h>
+#include <env.h>
#include <dm.h>
#include <dm/test.h>
#include <test/test.h>
diff --git a/test/cmd/mem_search.c b/test/cmd/mem_search.c
index df8938bdb6c6..61de0dfb9a98 100644
--- a/test/cmd/mem_search.c
+++ b/test/cmd/mem_search.c
@@ -7,6 +7,7 @@
*/
#include <console.h>
+#include <env.h>
#include <mapmem.h>
#include <dm/test.h>
#include <test/ut.h>
diff --git a/test/cmd/setexpr.c b/test/cmd/setexpr.c
index 85803eb54b8c..93b0c4b68f50 100644
--- a/test/cmd/setexpr.c
+++ b/test/cmd/setexpr.c
@@ -7,6 +7,7 @@
*/
#include <console.h>
+#include <env.h>
#include <mapmem.h>
#include <dm/test.h>
#include <test/ut.h>
diff --git a/test/common/test_autoboot.c b/test/common/test_autoboot.c
index e3050d02c605..5feff57c2714 100644
--- a/test/common/test_autoboot.c
+++ b/test/common/test_autoboot.c
@@ -6,6 +6,7 @@
*/
#include <autoboot.h>
+#include <env.h>
#include <test/common.h>
#include <test/test.h>
#include <test/ut.h>
diff --git a/test/dm/blkmap.c b/test/dm/blkmap.c
index a6a0b4d4e208..d04b68b50aec 100644
--- a/test/dm/blkmap.c
+++ b/test/dm/blkmap.c
@@ -7,6 +7,7 @@
#include <blk.h>
#include <blkmap.h>
#include <dm.h>
+#include <env.h>
#include <asm/test.h>
#include <dm/test.h>
#include <test/test.h>
diff --git a/test/dm/button.c b/test/dm/button.c
index 3612f308f029..f05f4ca27ceb 100644
--- a/test/dm/button.c
+++ b/test/dm/button.c
@@ -8,6 +8,7 @@
#include <dm.h>
#include <adc.h>
#include <button.h>
+#include <env.h>
#include <power/regulator.h>
#include <power/sandbox_pmic.h>
#include <asm/gpio.h>
diff --git a/test/dm/fastboot.c b/test/dm/fastboot.c
index 73c43f829240..5b51b6bf9dd4 100644
--- a/test/dm/fastboot.c
+++ b/test/dm/fastboot.c
@@ -4,6 +4,7 @@
*/
#include <dm.h>
+#include <env.h>
#include <fastboot.h>
#include <fb_mmc.h>
#include <mmc.h>
diff --git a/test/dm/part.c b/test/dm/part.c
index c5c4b3fdba1b..caae23bd4aad 100644
--- a/test/dm/part.c
+++ b/test/dm/part.c
@@ -4,6 +4,7 @@
*/
#include <dm.h>
+#include <env.h>
#include <mmc.h>
#include <part.h>
#include <part_efi.h>
diff --git a/test/env/fdt.c b/test/env/fdt.c
index c495ac7b307c..3652563f3304 100644
--- a/test/env/fdt.c
+++ b/test/env/fdt.c
@@ -1,4 +1,5 @@
#include <command.h>
+#include <env.h>
#include <env_attr.h>
#include <test/env.h>
#include <test/ut.h>
diff --git a/test/hush/dollar.c b/test/hush/dollar.c
index 820110799a20..b83a64d091d1 100644
--- a/test/hush/dollar.c
+++ b/test/hush/dollar.c
@@ -5,6 +5,7 @@
*/
#include <command.h>
+#include <env.h>
#include <env_attr.h>
#include <test/hush.h>
#include <test/ut.h>
diff --git a/test/hush/if.c b/test/hush/if.c
index 8939b7a6c86f..ea615b246a9a 100644
--- a/test/hush/if.c
+++ b/test/hush/if.c
@@ -5,6 +5,7 @@
*/
#include <command.h>
+#include <env.h>
#include <env_attr.h>
#include <vsprintf.h>
#include <test/hush.h>
diff --git a/test/hush/loop.c b/test/hush/loop.c
index 7154b9bc0ae3..ea72ac773bac 100644
--- a/test/hush/loop.c
+++ b/test/hush/loop.c
@@ -5,6 +5,7 @@
*/
#include <command.h>
+#include <env.h>
#include <env_attr.h>
#include <test/hush.h>
#include <test/ut.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* Re: [PATCH 4/5] global: Avoid indirect inclusion of <env.h> from <command.h>
2025-05-14 22:46 ` [PATCH 4/5] global: Avoid indirect inclusion of <env.h> from <command.h> Tom Rini
@ 2025-05-15 8:01 ` Mattijs Korpershoek
2025-05-15 11:52 ` Jerome Forissier
1 sibling, 0 replies; 38+ messages in thread
From: Mattijs Korpershoek @ 2025-05-15 8:01 UTC (permalink / raw)
To: Tom Rini, u-boot
Cc: Anatolij Gustschin, Bin Meng, Heinrich Schuchardt,
Ilias Apalodimas, Jaehoon Chung, Jerome Forissier, Linus Walleij,
Lukasz Majewski, Marek Vasut, Mark Kettenis, Masahisa Kojima,
Mattijs Korpershoek, Patrice Chotard, Patrick Delaunay,
Rayagonda Kokatanur, Simon Glass, Simon Goldschmidt, Stefan Bosch,
Tien Fong Chee, Tingting Meng, Tobias Waldekranz
Hi Tom,
Thank you for the patch.
On Wed, May 14, 2025 at 16:46, Tom Rini <trini@konsulko.com> wrote:
> The include file <command.h> does not need anything from <env.h>.
> Furthermore, include/env.h itself includes other headers which can lead
> to longer indirect inclusion paths. To prepare to remove <env.h> from
> <command.h> fix all of the places which had relied on this indirect
> inclusion to instead include <env.h> directly.
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org> # android, bcb
> ---
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 4/5] global: Avoid indirect inclusion of <env.h> from <command.h>
2025-05-14 22:46 ` [PATCH 4/5] global: Avoid indirect inclusion of <env.h> from <command.h> Tom Rini
2025-05-15 8:01 ` Mattijs Korpershoek
@ 2025-05-15 11:52 ` Jerome Forissier
1 sibling, 0 replies; 38+ messages in thread
From: Jerome Forissier @ 2025-05-15 11:52 UTC (permalink / raw)
To: Tom Rini, u-boot
Cc: Anatolij Gustschin, Bin Meng, Heinrich Schuchardt,
Ilias Apalodimas, Jaehoon Chung, Linus Walleij, Lukasz Majewski,
Marek Vasut, Mark Kettenis, Masahisa Kojima, Mattijs Korpershoek,
Patrice Chotard, Patrick Delaunay, Rayagonda Kokatanur,
Simon Glass, Simon Goldschmidt, Stefan Bosch, Tien Fong Chee,
Tingting Meng, Tobias Waldekranz
On 5/14/25 23:46, Tom Rini wrote:
> The include file <command.h> does not need anything from <env.h>.
> Furthermore, include/env.h itself includes other headers which can lead
> to longer indirect inclusion paths. To prepare to remove <env.h> from
> <command.h> fix all of the places which had relied on this indirect
> inclusion to instead include <env.h> directly.
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> # spawn
Thanks,
--
Jerome
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 5/5] include/command.h: Drop <env.h>
2025-05-14 22:45 [PATCH 0/5] Start removing <env.h> from headers when not required Tom Rini
` (3 preceding siblings ...)
2025-05-14 22:46 ` [PATCH 4/5] global: Avoid indirect inclusion of <env.h> from <command.h> Tom Rini
@ 2025-05-14 22:46 ` Tom Rini
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
2025-05-29 17:55 ` [PATCH 0/5] Start removing <env.h> from headers when not required Tom Rini
6 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-14 22:46 UTC (permalink / raw)
To: u-boot
Now that all of the cases of code that relied on <command.h> to provide
<env.h> (or one of the headers that it includes, and so forth) have been
fixed, we can drop the include from here.
Signed-off-by: Tom Rini <trini@konsulko.com>
---
include/command.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/include/command.h b/include/command.h
index 4158ca11b0ef..5d225cd197f7 100644
--- a/include/command.h
+++ b/include/command.h
@@ -10,7 +10,6 @@
#ifndef __COMMAND_H
#define __COMMAND_H
-#include <env.h>
#include <linker_lists.h>
#include <linux/compiler_attributes.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH v3 00/22] Remove <env.h> from <net.h>
2025-05-14 22:45 [PATCH 0/5] Start removing <env.h> from headers when not required Tom Rini
` (4 preceding siblings ...)
2025-05-14 22:46 ` [PATCH 5/5] include/command.h: Drop <env.h> Tom Rini
@ 2025-05-15 23:31 ` Tom Rini
2025-05-15 23:31 ` [PATCH v3 01/22] net: Remove env_get_ip helper() function Tom Rini
` (22 more replies)
2025-05-29 17:55 ` [PATCH 0/5] Start removing <env.h> from headers when not required Tom Rini
6 siblings, 23 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-15 23:31 UTC (permalink / raw)
To: u-boot
Hey all,
This is a v3 of Simon's series[1] and depends on the series[2] I posted
the other day that removes <env.h> from <command.h>. With this series
done, I believe we've tackled all of the current cases of headers which
include <env.h> without directly needing it. Much of this series is in
fact Simon's v2 with the main differneces being:
- Removing <env.h> from <net.h> at the end
- Removing env_to_ip() given how little it's used rather than shuffling
around where it's declared and un-inline'ing it. For a rarely used
helper, this ends up being cleaner I think. Especially looking at some
of the users (which called env_get repeatedly). If there's strong
opinion here about using the other method[3] we can do that instead.
- Setting aside for now how to handle CMD_ELF=y and NO_NET=y because
today it's actually fine as we unconditionally build lib/net_utils.c
where string_to_ip() is defined. I'm unsure if a further series is
warranted here or not. We rely on link-time optimization to keep code
readable too.
[1]: https://lore.kernel.org/all/20250501010456.3930701-1-sjg@chromium.org
[2]: https://lore.kernel.org/all/20250514225002.15361-1-trini@konsulko.com
[3]: https://lore.kernel.org/all/20250501010456.3930701-23-sjg@chromium.org
--
Tom
^ permalink raw reply [flat|nested] 38+ messages in thread* [PATCH v3 01/22] net: Remove env_get_ip helper() function
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
@ 2025-05-15 23:31 ` Tom Rini
2025-05-15 23:31 ` [PATCH v3 02/22] congatec: Include env.h to permit reading the environment Tom Rini
` (21 subsequent siblings)
22 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-15 23:31 UTC (permalink / raw)
To: u-boot; +Cc: Jerome Forissier, Simon Glass
Currently, we have the function env_get_ip which takes an IP address
in string form and returns a struct in_addr representation of that
address. It is however little used and means that a number of places
indirectly (and unclearly) get <env.h> via <net.h>. To clean this up
start by replacing env_get_ip() calls with string_to_ip() calls. This is
generally a no-op as env_get_ip(str) is an inline of
string_to_ip(env_get(str)) but in a few cases we can or already have
stored the result of env_get(str) and can save the additional call.
Signed-off-by: Tom Rini <trini@konsulko.com>
---
Changes in v3:
- New patch
Cc: Jerome Forissier <jerome.forissier@linaro.org>
Cc: Simon Glass <sjg@chromium.org>
---
cmd/elf.c | 2 +-
cmd/net.c | 2 +-
drivers/net/netconsole.c | 11 ++++++-----
include/net-common.h | 13 -------------
net/link_local.c | 2 +-
5 files changed, 9 insertions(+), 21 deletions(-)
diff --git a/cmd/elf.c b/cmd/elf.c
index 6b49c613703e..5e0ee30a7c86 100644
--- a/cmd/elf.c
+++ b/cmd/elf.c
@@ -247,7 +247,7 @@ int do_bootvx(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
ptr += sprintf(build_buf + ptr, "e=%s", tmp);
tmp = env_get("netmask");
if (tmp) {
- u32 mask = env_get_ip("netmask").s_addr;
+ u32 mask = string_to_ip(tmp).s_addr;
ptr += sprintf(build_buf + ptr,
":%08x ", ntohl(mask));
} else {
diff --git a/cmd/net.c b/cmd/net.c
index eaa1de5295f2..886735ea14f6 100644
--- a/cmd/net.c
+++ b/cmd/net.c
@@ -564,7 +564,7 @@ int do_sntp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
char *toff;
if (argc < 2) {
- net_ntp_server = env_get_ip("ntpserverip");
+ net_ntp_server = string_to_ip(env_get("ntpserverip"));
if (net_ntp_server.s_addr == 0) {
printf("ntpserverip not set\n");
return CMD_RET_FAILURE;
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 1943de8ba730..c2ce4a80d120 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -61,8 +61,8 @@ static int is_broadcast(struct in_addr ip)
/* update only when the environment has changed */
if (env_changed_id != env_id) {
- netmask = env_get_ip("netmask");
- our_ip = env_get_ip("ipaddr");
+ netmask = string_to_ip(env_get("netmask"));
+ our_ip = string_to_ip(env_get("ipaddr"));
env_changed_id = env_id;
}
@@ -81,11 +81,12 @@ static int refresh_settings_from_env(void)
/* update only when the environment has changed */
if (env_changed_id != env_id) {
- if (env_get("ncip")) {
- nc_ip = env_get_ip("ncip");
+ char *tmp = env_get("ncip");
+ if (tmp) {
+ nc_ip = string_to_ip(tmp);
if (!nc_ip.s_addr)
return -1; /* ncip is 0.0.0.0 */
- p = strchr(env_get("ncip"), ':');
+ p = strchr(tmp, ':');
if (p != NULL) {
nc_out_port = dectoul(p + 1, NULL);
nc_in_port = nc_out_port;
diff --git a/include/net-common.h b/include/net-common.h
index e536968a92bb..2ca565fe4edc 100644
--- a/include/net-common.h
+++ b/include/net-common.h
@@ -456,19 +456,6 @@ void net_process_received_packet(uchar *in_packet, int len);
*/
int update_tftp(ulong addr, char *interface, char *devstring);
-/**
- * env_get_ip() - Convert an environment value to an ip address
- *
- * @var: Environment variable to convert. The value of this variable must be
- * in the format a.b.c.d, where each value is a decimal number from
- * 0 to 255
- * Return: IP address, or 0 if invalid
- */
-static inline struct in_addr env_get_ip(char *var)
-{
- return string_to_ip(env_get(var));
-}
-
int net_init(void);
/* Called when a network operation fails to know if it should be re-tried */
diff --git a/net/link_local.c b/net/link_local.c
index 179721333ffc..f6425ff3df26 100644
--- a/net/link_local.c
+++ b/net/link_local.c
@@ -106,7 +106,7 @@ static void configure_wait(void)
void link_local_start(void)
{
- ip = env_get_ip("llipaddr");
+ ip = string_to_ip(env_get("llipaddr"));
if (ip.s_addr != 0 &&
(ntohl(ip.s_addr) & IN_CLASSB_NET) != LINKLOCAL_ADDR) {
puts("invalid link address");
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH v3 02/22] congatec: Include env.h to permit reading the environment
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
2025-05-15 23:31 ` [PATCH v3 01/22] net: Remove env_get_ip helper() function Tom Rini
@ 2025-05-15 23:31 ` Tom Rini
2025-05-15 23:31 ` [PATCH v3 03/22] dhelectronics: " Tom Rini
` (20 subsequent siblings)
22 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-15 23:31 UTC (permalink / raw)
To: u-boot; +Cc: Simon Glass
From: Simon Glass <sjg@chromium.org>
This file reads from the environment but does not include the correct
header. Update it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
Changes in v3:
- Keep config.h, update commit message - trini
---
board/congatec/cgtqmx8/cgtqmx8.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/board/congatec/cgtqmx8/cgtqmx8.c b/board/congatec/cgtqmx8/cgtqmx8.c
index 054e4e10867a..03be02a2884f 100644
--- a/board/congatec/cgtqmx8/cgtqmx8.c
+++ b/board/congatec/cgtqmx8/cgtqmx8.c
@@ -4,6 +4,7 @@
* Copyright (C) 2019 Oliver Graute <oliver.graute@kococonnector.com>
*/
#include <config.h>
+#include <env.h>
#include <errno.h>
#include <linux/libfdt.h>
#include <fsl_esdhc.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH v3 03/22] dhelectronics: Include env.h to permit reading the environment
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
2025-05-15 23:31 ` [PATCH v3 01/22] net: Remove env_get_ip helper() function Tom Rini
2025-05-15 23:31 ` [PATCH v3 02/22] congatec: Include env.h to permit reading the environment Tom Rini
@ 2025-05-15 23:31 ` Tom Rini
2025-05-15 23:31 ` [PATCH v3 04/22] imx8ulp_evk: " Tom Rini
` (19 subsequent siblings)
22 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-15 23:31 UTC (permalink / raw)
To: u-boot; +Cc: Simon Glass
From: Simon Glass <sjg@chromium.org>
This file reads from the environment but does not include the correct
header. Update it.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3:
- None
---
board/dhelectronics/common/dh_common.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/board/dhelectronics/common/dh_common.c b/board/dhelectronics/common/dh_common.c
index 71010803f555..8c052c45007a 100644
--- a/board/dhelectronics/common/dh_common.c
+++ b/board/dhelectronics/common/dh_common.c
@@ -5,6 +5,7 @@
*/
#include <dm.h>
+#include <env.h>
#include <i2c_eeprom.h>
#include <net.h>
#include <u-boot/crc.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH v3 04/22] imx8ulp_evk: Include env.h to permit reading the environment
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
` (2 preceding siblings ...)
2025-05-15 23:31 ` [PATCH v3 03/22] dhelectronics: " Tom Rini
@ 2025-05-15 23:31 ` Tom Rini
2025-05-15 23:31 ` [PATCH v3 05/22] net: Include string.h in net-legacy.h Tom Rini
` (18 subsequent siblings)
22 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-15 23:31 UTC (permalink / raw)
To: u-boot; +Cc: Simon Glass
From: Simon Glass <sjg@chromium.org>
This file reads from the environment but does not include the correct
header. Update it.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3:
- None
---
board/freescale/imx8ulp_evk/imx8ulp_evk.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/board/freescale/imx8ulp_evk/imx8ulp_evk.c b/board/freescale/imx8ulp_evk/imx8ulp_evk.c
index 0af610672637..4bf77a488ccd 100644
--- a/board/freescale/imx8ulp_evk/imx8ulp_evk.c
+++ b/board/freescale/imx8ulp_evk/imx8ulp_evk.c
@@ -3,6 +3,7 @@
* Copyright 2020 NXP
*/
+#include <env.h>
#include <miiphy.h>
#include <netdev.h>
#include <asm/arch/imx8ulp-pins.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH v3 05/22] net: Include string.h in net-legacy.h
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
` (3 preceding siblings ...)
2025-05-15 23:31 ` [PATCH v3 04/22] imx8ulp_evk: " Tom Rini
@ 2025-05-15 23:31 ` Tom Rini
2025-05-15 23:31 ` [PATCH v3 06/22] venice: Include env.h to permit reading the environment Tom Rini
` (17 subsequent siblings)
22 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-15 23:31 UTC (permalink / raw)
To: u-boot; +Cc: Simon Glass, Jerome Forissier
From: Simon Glass <sjg@chromium.org>
This file uses memcpy() but does not include the header file. Update it.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3:
- None
---
include/net-legacy.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/net-legacy.h b/include/net-legacy.h
index 51780999a883..a7dbcec1506b 100644
--- a/include/net-legacy.h
+++ b/include/net-legacy.h
@@ -17,6 +17,7 @@
#include <log.h>
#include <time.h>
#include <linux/if_ether.h>
+#include <linux/string.h>
struct bd_info;
struct cmd_tbl;
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH v3 06/22] venice: Include env.h to permit reading the environment
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
` (4 preceding siblings ...)
2025-05-15 23:31 ` [PATCH v3 05/22] net: Include string.h in net-legacy.h Tom Rini
@ 2025-05-15 23:31 ` Tom Rini
2025-05-15 23:31 ` [PATCH v3 07/22] phytec: " Tom Rini
` (16 subsequent siblings)
22 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-15 23:31 UTC (permalink / raw)
To: u-boot; +Cc: Simon Glass
From: Simon Glass <sjg@chromium.org>
This file reads from the environment but does not include the correct
header. Update it.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3:
- None
---
board/gateworks/venice/venice.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/board/gateworks/venice/venice.c b/board/gateworks/venice/venice.c
index 98b33624f041..f9bcdd8496ed 100644
--- a/board/gateworks/venice/venice.c
+++ b/board/gateworks/venice/venice.c
@@ -3,6 +3,7 @@
* Copyright 2021 Gateworks Corporation
*/
+#include <env.h>
#include <fdt_support.h>
#include <init.h>
#include <led.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH v3 07/22] phytec: Include env.h to permit reading the environment
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
` (5 preceding siblings ...)
2025-05-15 23:31 ` [PATCH v3 06/22] venice: Include env.h to permit reading the environment Tom Rini
@ 2025-05-15 23:31 ` Tom Rini
2025-05-15 23:31 ` [PATCH v3 08/22] ronetix: " Tom Rini
` (15 subsequent siblings)
22 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-15 23:31 UTC (permalink / raw)
To: u-boot; +Cc: Simon Glass
From: Simon Glass <sjg@chromium.org>
This file reads from the environment but does not include the correct
header. Update it.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3:
- None
---
board/phytec/common/phytec_som_detection_blocks.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/board/phytec/common/phytec_som_detection_blocks.c b/board/phytec/common/phytec_som_detection_blocks.c
index 5f3c27ef0c22..b44ff85972f9 100644
--- a/board/phytec/common/phytec_som_detection_blocks.c
+++ b/board/phytec/common/phytec_som_detection_blocks.c
@@ -4,6 +4,7 @@
* Author: Daniel Schultz <d.schultz@phytec.de>
*/
+#include <env.h>
#include <malloc.h>
#include <u-boot/crc.h>
#include <net.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH v3 08/22] ronetix: Include env.h to permit reading the environment
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
` (6 preceding siblings ...)
2025-05-15 23:31 ` [PATCH v3 07/22] phytec: " Tom Rini
@ 2025-05-15 23:31 ` Tom Rini
2025-05-15 23:31 ` [PATCH v3 09/22] toradex: " Tom Rini
` (14 subsequent siblings)
22 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-15 23:31 UTC (permalink / raw)
To: u-boot; +Cc: Simon Glass
From: Simon Glass <sjg@chromium.org>
This file reads from the environment but does not include the correct
header. Update it.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3:
- None
---
board/ronetix/imx8mq-cm/imx8mq_cm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/board/ronetix/imx8mq-cm/imx8mq_cm.c b/board/ronetix/imx8mq-cm/imx8mq_cm.c
index fbee2c39771e..602216854ba4 100644
--- a/board/ronetix/imx8mq-cm/imx8mq_cm.c
+++ b/board/ronetix/imx8mq-cm/imx8mq_cm.c
@@ -3,6 +3,7 @@
* Copyright 2018 NXP
*/
+#include <env.h>
#include <miiphy.h>
#include <asm-generic/gpio.h>
#include <asm/arch/imx8mq_pins.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH v3 09/22] toradex: Include env.h to permit reading the environment
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
` (7 preceding siblings ...)
2025-05-15 23:31 ` [PATCH v3 08/22] ronetix: " Tom Rini
@ 2025-05-15 23:31 ` Tom Rini
2025-05-15 23:31 ` [PATCH v3 10/22] advantech: Include env.h in imx8qm_dmsse20_a1 Tom Rini
` (13 subsequent siblings)
22 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-15 23:31 UTC (permalink / raw)
To: u-boot; +Cc: Simon Glass
From: Simon Glass <sjg@chromium.org>
Two files read from the environment but don't not include the correct
header. Update them.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3:
- None
---
board/toradex/colibri_imx7/colibri_imx7.c | 1 +
board/toradex/verdin-imx8mm/verdin-imx8mm.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/board/toradex/colibri_imx7/colibri_imx7.c b/board/toradex/colibri_imx7/colibri_imx7.c
index 7de29e3abfb6..69a8a18d3a75 100644
--- a/board/toradex/colibri_imx7/colibri_imx7.c
+++ b/board/toradex/colibri_imx7/colibri_imx7.c
@@ -4,6 +4,7 @@
*/
#include <cpu_func.h>
+#include <env.h>
#include <init.h>
#include <net.h>
#include <asm/arch/clock.h>
diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
index 9359e0ac6bff..066e8db678fb 100644
--- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c
+++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
@@ -3,7 +3,7 @@
* Copyright 2020-2021 Toradex
*/
-#include <config.h>
+#include <env.h>
#include <init.h>
#include <asm/arch/clock.h>
#include <asm/arch/sys_proto.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH v3 10/22] advantech: Include env.h in imx8qm_dmsse20_a1
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
` (8 preceding siblings ...)
2025-05-15 23:31 ` [PATCH v3 09/22] toradex: " Tom Rini
@ 2025-05-15 23:31 ` Tom Rini
2025-05-15 23:31 ` [PATCH v3 11/22] tegra: Include env.h to permit reading the environment Tom Rini
` (12 subsequent siblings)
22 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-15 23:31 UTC (permalink / raw)
To: u-boot; +Cc: Simon Glass, Oliver Graute
From: Simon Glass <sjg@chromium.org>
This file uses the environment but does not include the header file.
Update it.
Acked-by: Oliver Graute <oliver.graute@kococonnector.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3:
- None
---
board/advantech/imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/board/advantech/imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c b/board/advantech/imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c
index 50b35db5f6cf..accd300df04d 100644
--- a/board/advantech/imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c
+++ b/board/advantech/imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c
@@ -4,6 +4,7 @@
* Copyright 2019-2023 Kococonnector GmbH
*/
+#include <env.h>
#include <errno.h>
#include <linux/libfdt.h>
#include <asm/io.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH v3 11/22] tegra: Include env.h to permit reading the environment
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
` (9 preceding siblings ...)
2025-05-15 23:31 ` [PATCH v3 10/22] advantech: Include env.h in imx8qm_dmsse20_a1 Tom Rini
@ 2025-05-15 23:31 ` Tom Rini
2025-05-15 23:31 ` [PATCH v3 12/22] synology: " Tom Rini
` (11 subsequent siblings)
22 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-15 23:31 UTC (permalink / raw)
To: u-boot; +Cc: Simon Glass
From: Simon Glass <sjg@chromium.org>
This file reads from the environment but does not include the correct
header. Update it.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3:
- None
---
arch/arm/mach-tegra/dt-setup.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-tegra/dt-setup.c b/arch/arm/mach-tegra/dt-setup.c
index f4ae602d5239..96044ac78ce4 100644
--- a/arch/arm/mach-tegra/dt-setup.c
+++ b/arch/arm/mach-tegra/dt-setup.c
@@ -3,6 +3,7 @@
* Copyright (c) 2010-2016, NVIDIA CORPORATION.
*/
+#include <env.h>
#include <fdtdec.h>
#include <stdlib.h>
#include <asm/arch-tegra/cboot.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH v3 12/22] synology: Include env.h to permit reading the environment
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
` (10 preceding siblings ...)
2025-05-15 23:31 ` [PATCH v3 11/22] tegra: Include env.h to permit reading the environment Tom Rini
@ 2025-05-15 23:31 ` Tom Rini
2025-05-15 23:31 ` [PATCH v3 13/22] amlogic: " Tom Rini
` (10 subsequent siblings)
22 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-15 23:31 UTC (permalink / raw)
To: u-boot; +Cc: Simon Glass, Stefan Roese, Tony Dinh
From: Simon Glass <sjg@chromium.org>
This file reads from the environment but does not include the correct
header. Update it.
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Tony Dinh <mibodhi@gmail.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3:
- None
---
board/Synology/ds414/ds414.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/board/Synology/ds414/ds414.c b/board/Synology/ds414/ds414.c
index 1a4cea87e1a7..02d6a4a1ea8a 100644
--- a/board/Synology/ds414/ds414.c
+++ b/board/Synology/ds414/ds414.c
@@ -4,6 +4,7 @@
* Copyright (C) 2015 Phil Sutter <phil@nwl.cc>
*/
+#include <env.h>
#include <init.h>
#include <miiphy.h>
#include <asm/global_data.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH v3 13/22] amlogic: Include env.h to permit reading the environment
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
` (11 preceding siblings ...)
2025-05-15 23:31 ` [PATCH v3 12/22] synology: " Tom Rini
@ 2025-05-15 23:31 ` Tom Rini
2025-05-15 23:31 ` [PATCH v3 14/22] freescale: " Tom Rini
` (9 subsequent siblings)
22 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-15 23:31 UTC (permalink / raw)
To: u-boot; +Cc: Simon Glass, Viacheslav Bocharov
From: Simon Glass <sjg@chromium.org>
This file reads from the environment but does not include the correct
header. Update it.
Reviewed-by: Viacheslav Bocharov <adeep@lexina.in>
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3:
- None
---
board/amlogic/jethub-j100/jethub-j100.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/board/amlogic/jethub-j100/jethub-j100.c b/board/amlogic/jethub-j100/jethub-j100.c
index b770a1f8c537..9e87fb9f9d73 100644
--- a/board/amlogic/jethub-j100/jethub-j100.c
+++ b/board/amlogic/jethub-j100/jethub-j100.c
@@ -5,6 +5,7 @@
*/
#include <dm.h>
+#include <env.h>
#include <init.h>
#include <net.h>
#include <asm/io.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH v3 14/22] freescale: Include env.h to permit reading the environment
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
` (12 preceding siblings ...)
2025-05-15 23:31 ` [PATCH v3 13/22] amlogic: " Tom Rini
@ 2025-05-15 23:31 ` Tom Rini
2025-05-15 23:31 ` [PATCH v3 15/22] google: " Tom Rini
` (8 subsequent siblings)
22 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-15 23:31 UTC (permalink / raw)
To: u-boot; +Cc: Simon Glass
From: Simon Glass <sjg@chromium.org>
This file reads from the environment but does not include the correct
header. Update it.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3:
- None
---
board/freescale/mx7dsabresd/mx7dsabresd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/board/freescale/mx7dsabresd/mx7dsabresd.c b/board/freescale/mx7dsabresd/mx7dsabresd.c
index 3db167c0dad3..bef4f901ff74 100644
--- a/board/freescale/mx7dsabresd/mx7dsabresd.c
+++ b/board/freescale/mx7dsabresd/mx7dsabresd.c
@@ -3,6 +3,7 @@
* Copyright (C) 2015 Freescale Semiconductor, Inc.
*/
+#include <env.h>
#include <init.h>
#include <net.h>
#include <asm/arch/clock.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH v3 15/22] google: Include env.h to permit reading the environment
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
` (13 preceding siblings ...)
2025-05-15 23:31 ` [PATCH v3 14/22] freescale: " Tom Rini
@ 2025-05-15 23:31 ` Tom Rini
2025-05-15 23:31 ` [PATCH v3 16/22] liebherr: " Tom Rini
` (7 subsequent siblings)
22 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-15 23:31 UTC (permalink / raw)
To: u-boot; +Cc: Simon Glass
From: Simon Glass <sjg@chromium.org>
This file reads from the environment but does not include the correct
header. Update it.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3:
- None
---
board/google/chameleonv3/board.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/board/google/chameleonv3/board.c b/board/google/chameleonv3/board.c
index 4d3049689d3a..d8ffdd25b387 100644
--- a/board/google/chameleonv3/board.c
+++ b/board/google/chameleonv3/board.c
@@ -2,6 +2,8 @@
/*
* Copyright 2022 Google LLC
*/
+
+#include <env.h>
#include <net.h>
#include <errno.h>
#include "mercury_aa1.h"
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH v3 16/22] liebherr: Include env.h to permit reading the environment
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
` (14 preceding siblings ...)
2025-05-15 23:31 ` [PATCH v3 15/22] google: " Tom Rini
@ 2025-05-15 23:31 ` Tom Rini
2025-05-16 5:29 ` Lukasz Majewski
2025-05-15 23:31 ` [PATCH v3 17/22] technexion: " Tom Rini
` (6 subsequent siblings)
22 siblings, 1 reply; 38+ messages in thread
From: Tom Rini @ 2025-05-15 23:31 UTC (permalink / raw)
To: u-boot; +Cc: Simon Glass, Lukasz Majewski
From: Simon Glass <sjg@chromium.org>
This file reads from the environment but does not include the correct
header. Update it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
---
Changes in v3:
- None
---
board/liebherr/xea/xea.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/board/liebherr/xea/xea.c b/board/liebherr/xea/xea.c
index 1d4f165fd13a..9630e7f576b2 100644
--- a/board/liebherr/xea/xea.c
+++ b/board/liebherr/xea/xea.c
@@ -13,6 +13,7 @@
*
*/
+#include <env.h>
#include <fdt_support.h>
#include <init.h>
#include <log.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* Re: [PATCH v3 16/22] liebherr: Include env.h to permit reading the environment
2025-05-15 23:31 ` [PATCH v3 16/22] liebherr: " Tom Rini
@ 2025-05-16 5:29 ` Lukasz Majewski
0 siblings, 0 replies; 38+ messages in thread
From: Lukasz Majewski @ 2025-05-16 5:29 UTC (permalink / raw)
To: Tom Rini; +Cc: u-boot, Simon Glass
[-- Attachment #1: Type: text/plain, Size: 1053 bytes --]
On Thu, 15 May 2025 17:31:45 -0600
Tom Rini <trini@konsulko.com> wrote:
> From: Simon Glass <sjg@chromium.org>
>
> This file reads from the environment but does not include the correct
> header. Update it.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Lukasz Majewski <lukma@denx.de>
> ---
> Changes in v3:
> - None
> ---
> board/liebherr/xea/xea.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/board/liebherr/xea/xea.c b/board/liebherr/xea/xea.c
> index 1d4f165fd13a..9630e7f576b2 100644
> --- a/board/liebherr/xea/xea.c
> +++ b/board/liebherr/xea/xea.c
> @@ -13,6 +13,7 @@
> *
> */
>
> +#include <env.h>
> #include <fdt_support.h>
> #include <init.h>
> #include <log.h>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH v3 17/22] technexion: Include env.h to permit reading the environment
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
` (15 preceding siblings ...)
2025-05-15 23:31 ` [PATCH v3 16/22] liebherr: " Tom Rini
@ 2025-05-15 23:31 ` Tom Rini
2025-05-15 23:31 ` [PATCH v3 18/22] net: Include byteorder in net6.h Tom Rini
` (5 subsequent siblings)
22 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-15 23:31 UTC (permalink / raw)
To: u-boot; +Cc: Simon Glass
From: Simon Glass <sjg@chromium.org>
This file reads from the environment but does not include the correct
header. Update it.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3:
- None
---
board/technexion/pico-imx7d/pico-imx7d.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/board/technexion/pico-imx7d/pico-imx7d.c b/board/technexion/pico-imx7d/pico-imx7d.c
index d0f739c624a1..cf6b7fcbd958 100644
--- a/board/technexion/pico-imx7d/pico-imx7d.c
+++ b/board/technexion/pico-imx7d/pico-imx7d.c
@@ -3,6 +3,7 @@
* Copyright (C) 2017 NXP Semiconductors
*/
+#include <env.h>
#include <init.h>
#include <net.h>
#include <asm/arch/clock.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH v3 18/22] net: Include byteorder in net6.h
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
` (16 preceding siblings ...)
2025-05-15 23:31 ` [PATCH v3 17/22] technexion: " Tom Rini
@ 2025-05-15 23:31 ` Tom Rini
2025-05-15 23:31 ` [PATCH v3 19/22] net: Include env.h in pcap.c Tom Rini
` (4 subsequent siblings)
22 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-15 23:31 UTC (permalink / raw)
To: u-boot; +Cc: Simon Glass
From: Simon Glass <sjg@chromium.org>
This file uses byteorder but does not include the header file. Update
it.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3:
- None
---
include/net6.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/net6.h b/include/net6.h
index 2ceeaba06399..39573e490a66 100644
--- a/include/net6.h
+++ b/include/net6.h
@@ -11,6 +11,7 @@
#define __NET6_H__
#include <net.h>
+#include <asm/byteorder.h>
#include <linux/ctype.h>
#include <linux/errno.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH v3 19/22] net: Include env.h in pcap.c
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
` (17 preceding siblings ...)
2025-05-15 23:31 ` [PATCH v3 18/22] net: Include byteorder in net6.h Tom Rini
@ 2025-05-15 23:31 ` Tom Rini
2025-05-15 23:31 ` [PATCH v3 20/22] net: dc2114x: Include env.h to permit reading the environment Tom Rini
` (3 subsequent siblings)
22 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-15 23:31 UTC (permalink / raw)
To: u-boot; +Cc: Simon Glass
From: Simon Glass <sjg@chromium.org>
This file uses the environment but does not include the header file.
Update it.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3:
- None
---
net/pcap.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/pcap.c b/net/pcap.c
index c959e3e4e511..d1d6f705cda0 100644
--- a/net/pcap.c
+++ b/net/pcap.c
@@ -3,6 +3,7 @@
* Copyright 2019 Ramon Fried <rfried.dev@gmail.com>
*/
+#include <env.h>
#include <net.h>
#include <net/pcap.h>
#include <time.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH v3 20/22] net: dc2114x: Include env.h to permit reading the environment
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
` (18 preceding siblings ...)
2025-05-15 23:31 ` [PATCH v3 19/22] net: Include env.h in pcap.c Tom Rini
@ 2025-05-15 23:31 ` Tom Rini
2025-05-15 23:31 ` [PATCH v3 21/22] global: Avoid indirect inclusion of <env.h> from <net.h> Tom Rini
` (2 subsequent siblings)
22 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-15 23:31 UTC (permalink / raw)
To: u-boot; +Cc: Simon Glass
From: Simon Glass <sjg@chromium.org>
This file uses the environment but does not include the header file.
Update it.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3:
- None
---
drivers/net/dc2114x.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/dc2114x.c b/drivers/net/dc2114x.c
index 7c0665faa8e1..8fa549280aac 100644
--- a/drivers/net/dc2114x.c
+++ b/drivers/net/dc2114x.c
@@ -3,6 +3,7 @@
#include <asm/io.h>
#include <cpu_func.h>
#include <dm.h>
+#include <env.h>
#include <malloc.h>
#include <net.h>
#include <netdev.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH v3 21/22] global: Avoid indirect inclusion of <env.h> from <net.h>
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
` (19 preceding siblings ...)
2025-05-15 23:31 ` [PATCH v3 20/22] net: dc2114x: Include env.h to permit reading the environment Tom Rini
@ 2025-05-15 23:31 ` Tom Rini
2025-05-16 12:48 ` Jerome Forissier
` (3 more replies)
2025-05-15 23:31 ` [PATCH v3 22/22] include/net.h: Drop <env.h> Tom Rini
2025-05-29 17:55 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
22 siblings, 4 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-15 23:31 UTC (permalink / raw)
To: u-boot
Cc: Huan 'Kitty' Wang, Ying-Chun Liu (PaulLiu), Angus Ainslie,
Heinrich Schuchardt, Ian Ray, Ilias Apalodimas, Jan Kiszka,
Jerome Forissier, Joe Hershberger, Le Jin, Martyn Welch,
Niel Fourie, Ramon Fried, Rick Chen, Simon Glass, Tim Harvey,
Wolfgang Wallner
Now that env_get_ip() has been removed, the include file <net.h> does
not need anything from <env.h>. Furthermore, include/env.h itself
includes other headers which can lead to longer indirect inclusion
paths. To prepare to remove <env.h> from <net.h> fix all of the
remaining places which had relied on this indirect inclusion to instead
include <env.h> directly.
Signed-off-by: Tom Rini <trini@konsulko.com>
---
Changes in v3:
- New patch
Cc: "Huan 'Kitty' Wang" <HuanWang@gehealthcare.com>
Cc: "Ying-Chun Liu (PaulLiu)" <paul.liu@linaro.org>
Cc: Angus Ainslie <angus@akkea.ca> (supporter:PURISM LIBREM5 PHONE)
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Ian Ray <ian.ray@gehealthcare.com>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Jerome Forissier <jerome.forissier@linaro.org>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Le Jin <le.jin@siemens.com>
Cc: Martyn Welch <martyn.welch@collabora.com>
Cc: Niel Fourie <lusus@denx.de>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Rick Chen <rick@andestech.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tim Harvey <tharvey@gateworks.com>
Cc: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
---
board/BuR/brppt2/board.c | 1 +
board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c | 1 +
board/andestech/ae350/ae350.c | 1 +
board/data_modul/common/common.c | 1 +
board/gateworks/gw_ventana/gw_ventana.c | 1 +
board/ge/b1x5v2/b1x5v2.c | 1 +
board/keymile/kmcent2/kmcent2.c | 1 +
board/purism/librem5/librem5.c | 1 +
board/siemens/iot2050/board.c | 1 +
board/ti/j721e/evm.c | 1 +
boot/bootmeth_efi.c | 1 +
boot/bootmeth_pxe.c | 1 +
cmd/pxe.c | 1 +
drivers/net/pfe_eth/pfe_firmware.c | 1 +
lib/efi_loader/efi_bootmgr.c | 1 +
lib/efi_loader/efi_net.c | 1 +
net/lwip/dhcp.c | 1 +
net/lwip/dns.c | 1 +
net/lwip/net-lwip.c | 1 +
net/lwip/tftp.c | 1 +
net/lwip/wget.c | 1 +
test/dm/dsa.c | 1 +
22 files changed, 22 insertions(+)
diff --git a/board/BuR/brppt2/board.c b/board/BuR/brppt2/board.c
index c0a163251b46..de206bdf1bc4 100644
--- a/board/BuR/brppt2/board.c
+++ b/board/BuR/brppt2/board.c
@@ -7,6 +7,7 @@
*
*/
#include <cpu_func.h>
+#include <env.h>
#include <hang.h>
#include <init.h>
#include <spl.h>
diff --git a/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c b/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c
index b9f47006d610..8c9e98308765 100644
--- a/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c
+++ b/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c
@@ -7,6 +7,7 @@
#include <dwc3-uboot.h>
#include <efi.h>
#include <efi_loader.h>
+#include <env.h>
#include <errno.h>
#include <miiphy.h>
#include <netdev.h>
diff --git a/board/andestech/ae350/ae350.c b/board/andestech/ae350/ae350.c
index 1d9d4a929c22..9bdd2ab17805 100644
--- a/board/andestech/ae350/ae350.c
+++ b/board/andestech/ae350/ae350.c
@@ -6,6 +6,7 @@
#include <config.h>
#include <cpu_func.h>
+#include <env.h>
#include <flash.h>
#include <image.h>
#include <init.h>
diff --git a/board/data_modul/common/common.c b/board/data_modul/common/common.c
index 9e35dc5d6cb1..7d344792937e 100644
--- a/board/data_modul/common/common.c
+++ b/board/data_modul/common/common.c
@@ -12,6 +12,7 @@
#include <asm/mach-imx/boot_mode.h>
#include <asm/mach-imx/iomux-v3.h>
#include <dm/uclass.h>
+#include <env.h>
#include <hang.h>
#include <i2c_eeprom.h>
#include <image.h>
diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c
index 21a908c20dd5..457d8281a664 100644
--- a/board/gateworks/gw_ventana/gw_ventana.c
+++ b/board/gateworks/gw_ventana/gw_ventana.c
@@ -6,6 +6,7 @@
*/
#include <command.h>
+#include <env.h>
#include <fdt_support.h>
#include <gsc.h>
#include <hwconfig.h>
diff --git a/board/ge/b1x5v2/b1x5v2.c b/board/ge/b1x5v2/b1x5v2.c
index c1aacd1458b1..ddb7304d493a 100644
--- a/board/ge/b1x5v2/b1x5v2.c
+++ b/board/ge/b1x5v2/b1x5v2.c
@@ -17,6 +17,7 @@
#include <asm/io.h>
#include <asm/mach-imx/video.h>
#include <command.h>
+#include <env.h>
#include <i2c.h>
#include <input.h>
#include <ipu_pixfmt.h>
diff --git a/board/keymile/kmcent2/kmcent2.c b/board/keymile/kmcent2/kmcent2.c
index 783853d5c6f6..0f43ebfec4d5 100644
--- a/board/keymile/kmcent2/kmcent2.c
+++ b/board/keymile/kmcent2/kmcent2.c
@@ -6,6 +6,7 @@
* Copyright 2013 Freescale Semiconductor, Inc.
*/
+#include <env.h>
#include <event.h>
#include <asm/cache.h>
#include <asm/fsl_fdt.h>
diff --git a/board/purism/librem5/librem5.c b/board/purism/librem5/librem5.c
index 8ca8792fa422..5178ee6929d8 100644
--- a/board/purism/librem5/librem5.c
+++ b/board/purism/librem5/librem5.c
@@ -6,6 +6,7 @@
#include <malloc.h>
#include <errno.h>
+#include <env.h>
#include <asm/io.h>
#include <miiphy.h>
#include <asm/mach-imx/iomux-v3.h>
diff --git a/board/siemens/iot2050/board.c b/board/siemens/iot2050/board.c
index d827f728a08c..161210c60a96 100644
--- a/board/siemens/iot2050/board.c
+++ b/board/siemens/iot2050/board.c
@@ -11,6 +11,7 @@
#include <config.h>
#include <bootstage.h>
#include <dm.h>
+#include <env.h>
#include <fdt_support.h>
#include <i2c.h>
#include <led.h>
diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c
index 0525f6e6f979..b1ed29af0018 100644
--- a/board/ti/j721e/evm.c
+++ b/board/ti/j721e/evm.c
@@ -8,6 +8,7 @@
*/
#include <efi_loader.h>
+#include <env.h>
#include <generic-phy.h>
#include <image.h>
#include <net.h>
diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c
index 0c9b4c3d59dc..0af23df3a4a5 100644
--- a/boot/bootmeth_efi.c
+++ b/boot/bootmeth_efi.c
@@ -15,6 +15,7 @@
#include <dm.h>
#include <efi.h>
#include <efi_loader.h>
+#include <env.h>
#include <fs.h>
#include <malloc.h>
#include <mapmem.h>
diff --git a/boot/bootmeth_pxe.c b/boot/bootmeth_pxe.c
index 6e5e0f99ea42..faa8d729b151 100644
--- a/boot/bootmeth_pxe.c
+++ b/boot/bootmeth_pxe.c
@@ -13,6 +13,7 @@
#include <bootmeth.h>
#include <command.h>
#include <dm.h>
+#include <env.h>
#include <extlinux.h>
#include <fs.h>
#include <log.h>
diff --git a/cmd/pxe.c b/cmd/pxe.c
index 0f26b3b42197..e82247af6c07 100644
--- a/cmd/pxe.c
+++ b/cmd/pxe.c
@@ -5,6 +5,7 @@
*/
#include <command.h>
+#include <env.h>
#include <fs.h>
#include <net.h>
#include <net6.h>
diff --git a/drivers/net/pfe_eth/pfe_firmware.c b/drivers/net/pfe_eth/pfe_firmware.c
index da4f2ca42a5b..b821fb17a1d6 100644
--- a/drivers/net/pfe_eth/pfe_firmware.c
+++ b/drivers/net/pfe_eth/pfe_firmware.c
@@ -12,6 +12,7 @@
#include <dm.h>
#include <dm/device-internal.h>
+#include <env.h>
#include <image.h>
#include <log.h>
#include <malloc.h>
diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c
index c0df5cb9acd9..298149bcc332 100644
--- a/lib/efi_loader/efi_bootmgr.c
+++ b/lib/efi_loader/efi_bootmgr.c
@@ -12,6 +12,7 @@
#include <charset.h>
#include <dm.h>
#include <efi.h>
+#include <env.h>
#include <log.h>
#include <malloc.h>
#include <net.h>
diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c
index b3291b4f1d52..9db738ead9dd 100644
--- a/lib/efi_loader/efi_net.c
+++ b/lib/efi_loader/efi_net.c
@@ -18,6 +18,7 @@
#define LOG_CATEGORY LOGC_EFI
#include <efi_loader.h>
+#include <env.h>
#include <dm.h>
#include <linux/sizes.h>
#include <malloc.h>
diff --git a/net/lwip/dhcp.c b/net/lwip/dhcp.c
index 92bd7067a7fb..043d2ab6e946 100644
--- a/net/lwip/dhcp.c
+++ b/net/lwip/dhcp.c
@@ -3,6 +3,7 @@
#include <command.h>
#include <console.h>
+#include <env.h>
#include <log.h>
#include <dm/device.h>
#include <linux/delay.h>
diff --git a/net/lwip/dns.c b/net/lwip/dns.c
index 19172ac959ac..6862869d9e30 100644
--- a/net/lwip/dns.c
+++ b/net/lwip/dns.c
@@ -3,6 +3,7 @@
#include <command.h>
#include <console.h>
+#include <env.h>
#include <lwip/dns.h>
#include <lwip/timeouts.h>
#include <net.h>
diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c
index f05c4cd3f64f..abc52b32049c 100644
--- a/net/lwip/net-lwip.c
+++ b/net/lwip/net-lwip.c
@@ -3,6 +3,7 @@
/* Copyright (C) 2024 Linaro Ltd. */
#include <command.h>
+#include <env.h>
#include <dm/device.h>
#include <dm/uclass.h>
#include <hexdump.h>
diff --git a/net/lwip/tftp.c b/net/lwip/tftp.c
index 4f9b2049187c..56d27f821212 100644
--- a/net/lwip/tftp.c
+++ b/net/lwip/tftp.c
@@ -6,6 +6,7 @@
#include <display_options.h>
#include <dm/device.h>
#include <efi_loader.h>
+#include <env.h>
#include <image.h>
#include <linux/delay.h>
#include <lwip/apps/tftp_client.h>
diff --git a/net/lwip/wget.c b/net/lwip/wget.c
index a3b82908877f..46c16edcc440 100644
--- a/net/lwip/wget.c
+++ b/net/lwip/wget.c
@@ -5,6 +5,7 @@
#include <console.h>
#include <display_options.h>
#include <efi_loader.h>
+#include <env.h>
#include <image.h>
#include <lwip/apps/http_client.h>
#include "lwip/altcp_tls.h"
diff --git a/test/dm/dsa.c b/test/dm/dsa.c
index 9a31ae39d952..46e48741fbaa 100644
--- a/test/dm/dsa.c
+++ b/test/dm/dsa.c
@@ -3,6 +3,7 @@
* Copyright 2020-2021 NXP
*/
+#include <env.h>
#include <net/dsa.h>
#include <dm/test.h>
#include <test/ut.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* Re: [PATCH v3 21/22] global: Avoid indirect inclusion of <env.h> from <net.h>
2025-05-15 23:31 ` [PATCH v3 21/22] global: Avoid indirect inclusion of <env.h> from <net.h> Tom Rini
@ 2025-05-16 12:48 ` Jerome Forissier
2025-05-16 14:20 ` Martyn Welch
` (2 subsequent siblings)
3 siblings, 0 replies; 38+ messages in thread
From: Jerome Forissier @ 2025-05-16 12:48 UTC (permalink / raw)
To: Tom Rini, u-boot
Cc: Huan 'Kitty' Wang, Ying-Chun Liu (PaulLiu), Angus Ainslie,
Heinrich Schuchardt, Ian Ray, Ilias Apalodimas, Jan Kiszka,
Joe Hershberger, Le Jin, Martyn Welch, Niel Fourie, Ramon Fried,
Rick Chen, Simon Glass, Tim Harvey, Wolfgang Wallner
On 5/16/25 00:31, Tom Rini wrote:
> Now that env_get_ip() has been removed, the include file <net.h> does
> not need anything from <env.h>. Furthermore, include/env.h itself
> includes other headers which can lead to longer indirect inclusion
> paths. To prepare to remove <env.h> from <net.h> fix all of the
> remaining places which had relied on this indirect inclusion to instead
> include <env.h> directly.
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> Changes in v3:
> - New patch
>
> Cc: "Huan 'Kitty' Wang" <HuanWang@gehealthcare.com>
> Cc: "Ying-Chun Liu (PaulLiu)" <paul.liu@linaro.org>
> Cc: Angus Ainslie <angus@akkea.ca> (supporter:PURISM LIBREM5 PHONE)
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Cc: Ian Ray <ian.ray@gehealthcare.com>
> Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> Cc: Jan Kiszka <jan.kiszka@siemens.com>
> Cc: Jerome Forissier <jerome.forissier@linaro.org>
> Cc: Joe Hershberger <joe.hershberger@ni.com>
> Cc: Le Jin <le.jin@siemens.com>
> Cc: Martyn Welch <martyn.welch@collabora.com>
> Cc: Niel Fourie <lusus@denx.de>
> Cc: Ramon Fried <rfried.dev@gmail.com>
> Cc: Rick Chen <rick@andestech.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Tim Harvey <tharvey@gateworks.com>
> Cc: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
> ---
> board/BuR/brppt2/board.c | 1 +
> board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c | 1 +
> board/andestech/ae350/ae350.c | 1 +
> board/data_modul/common/common.c | 1 +
> board/gateworks/gw_ventana/gw_ventana.c | 1 +
> board/ge/b1x5v2/b1x5v2.c | 1 +
> board/keymile/kmcent2/kmcent2.c | 1 +
> board/purism/librem5/librem5.c | 1 +
> board/siemens/iot2050/board.c | 1 +
> board/ti/j721e/evm.c | 1 +
> boot/bootmeth_efi.c | 1 +
> boot/bootmeth_pxe.c | 1 +
> cmd/pxe.c | 1 +
> drivers/net/pfe_eth/pfe_firmware.c | 1 +
> lib/efi_loader/efi_bootmgr.c | 1 +
> lib/efi_loader/efi_net.c | 1 +
> net/lwip/dhcp.c | 1 +
> net/lwip/dns.c | 1 +
> net/lwip/net-lwip.c | 1 +
> net/lwip/tftp.c | 1 +
> net/lwip/wget.c | 1 +
> test/dm/dsa.c | 1 +
> 22 files changed, 22 insertions(+)
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> # net/lwip
^ permalink raw reply [flat|nested] 38+ messages in thread* Re: [PATCH v3 21/22] global: Avoid indirect inclusion of <env.h> from <net.h>
2025-05-15 23:31 ` [PATCH v3 21/22] global: Avoid indirect inclusion of <env.h> from <net.h> Tom Rini
2025-05-16 12:48 ` Jerome Forissier
@ 2025-05-16 14:20 ` Martyn Welch
2025-05-19 8:19 ` Wolfgang Wallner
2025-05-19 8:23 ` Ilias Apalodimas
3 siblings, 0 replies; 38+ messages in thread
From: Martyn Welch @ 2025-05-16 14:20 UTC (permalink / raw)
To: Tom Rini, u-boot
Cc: Huan 'Kitty' Wang, Ying-Chun Liu (PaulLiu), Angus Ainslie,
Heinrich Schuchardt, Ian Ray, Ilias Apalodimas, Jan Kiszka,
Jerome Forissier, Joe Hershberger, Le Jin, Niel Fourie,
Ramon Fried, Rick Chen, Simon Glass, Tim Harvey, Wolfgang Wallner
On 16/05/2025 00:31, Tom Rini wrote:
> Now that env_get_ip() has been removed, the include file <net.h> does
> not need anything from <env.h>. Furthermore, include/env.h itself
> includes other headers which can lead to longer indirect inclusion
> paths. To prepare to remove <env.h> from <net.h> fix all of the
> remaining places which had relied on this indirect inclusion to instead
> include <env.h> directly.
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> Changes in v3:
> - New patch
>
> Cc: "Huan 'Kitty' Wang" <HuanWang@gehealthcare.com>
> Cc: "Ying-Chun Liu (PaulLiu)" <paul.liu@linaro.org>
> Cc: Angus Ainslie <angus@akkea.ca> (supporter:PURISM LIBREM5 PHONE)
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Cc: Ian Ray <ian.ray@gehealthcare.com>
> Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> Cc: Jan Kiszka <jan.kiszka@siemens.com>
> Cc: Jerome Forissier <jerome.forissier@linaro.org>
> Cc: Joe Hershberger <joe.hershberger@ni.com>
> Cc: Le Jin <le.jin@siemens.com>
> Cc: Martyn Welch <martyn.welch@collabora.com>
> Cc: Niel Fourie <lusus@denx.de>
> Cc: Ramon Fried <rfried.dev@gmail.com>
> Cc: Rick Chen <rick@andestech.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Tim Harvey <tharvey@gateworks.com>
> Cc: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
> ---
> board/BuR/brppt2/board.c | 1 +
> board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c | 1 +
> board/andestech/ae350/ae350.c | 1 +
> board/data_modul/common/common.c | 1 +
> board/gateworks/gw_ventana/gw_ventana.c | 1 +
> board/ge/b1x5v2/b1x5v2.c | 1 +
For b1x5v2.c:
Reviewed-by: Martyn Welch <martyn.welch@collabora.com>
> board/keymile/kmcent2/kmcent2.c | 1 +
> board/purism/librem5/librem5.c | 1 +
> board/siemens/iot2050/board.c | 1 +
> board/ti/j721e/evm.c | 1 +
> boot/bootmeth_efi.c | 1 +
> boot/bootmeth_pxe.c | 1 +
> cmd/pxe.c | 1 +
> drivers/net/pfe_eth/pfe_firmware.c | 1 +
> lib/efi_loader/efi_bootmgr.c | 1 +
> lib/efi_loader/efi_net.c | 1 +
> net/lwip/dhcp.c | 1 +
> net/lwip/dns.c | 1 +
> net/lwip/net-lwip.c | 1 +
> net/lwip/tftp.c | 1 +
> net/lwip/wget.c | 1 +
> test/dm/dsa.c | 1 +
> 22 files changed, 22 insertions(+)
>
> diff --git a/board/BuR/brppt2/board.c b/board/BuR/brppt2/board.c
> index c0a163251b46..de206bdf1bc4 100644
> --- a/board/BuR/brppt2/board.c
> +++ b/board/BuR/brppt2/board.c
> @@ -7,6 +7,7 @@
> *
> */
> #include <cpu_func.h>
> +#include <env.h>
> #include <hang.h>
> #include <init.h>
> #include <spl.h>
> diff --git a/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c b/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c
> index b9f47006d610..8c9e98308765 100644
> --- a/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c
> +++ b/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c
> @@ -7,6 +7,7 @@
> #include <dwc3-uboot.h>
> #include <efi.h>
> #include <efi_loader.h>
> +#include <env.h>
> #include <errno.h>
> #include <miiphy.h>
> #include <netdev.h>
> diff --git a/board/andestech/ae350/ae350.c b/board/andestech/ae350/ae350.c
> index 1d9d4a929c22..9bdd2ab17805 100644
> --- a/board/andestech/ae350/ae350.c
> +++ b/board/andestech/ae350/ae350.c
> @@ -6,6 +6,7 @@
>
> #include <config.h>
> #include <cpu_func.h>
> +#include <env.h>
> #include <flash.h>
> #include <image.h>
> #include <init.h>
> diff --git a/board/data_modul/common/common.c b/board/data_modul/common/common.c
> index 9e35dc5d6cb1..7d344792937e 100644
> --- a/board/data_modul/common/common.c
> +++ b/board/data_modul/common/common.c
> @@ -12,6 +12,7 @@
> #include <asm/mach-imx/boot_mode.h>
> #include <asm/mach-imx/iomux-v3.h>
> #include <dm/uclass.h>
> +#include <env.h>
> #include <hang.h>
> #include <i2c_eeprom.h>
> #include <image.h>
> diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c
> index 21a908c20dd5..457d8281a664 100644
> --- a/board/gateworks/gw_ventana/gw_ventana.c
> +++ b/board/gateworks/gw_ventana/gw_ventana.c
> @@ -6,6 +6,7 @@
> */
>
> #include <command.h>
> +#include <env.h>
> #include <fdt_support.h>
> #include <gsc.h>
> #include <hwconfig.h>
> diff --git a/board/ge/b1x5v2/b1x5v2.c b/board/ge/b1x5v2/b1x5v2.c
> index c1aacd1458b1..ddb7304d493a 100644
> --- a/board/ge/b1x5v2/b1x5v2.c
> +++ b/board/ge/b1x5v2/b1x5v2.c
> @@ -17,6 +17,7 @@
> #include <asm/io.h>
> #include <asm/mach-imx/video.h>
> #include <command.h>
> +#include <env.h>
> #include <i2c.h>
> #include <input.h>
> #include <ipu_pixfmt.h>
> diff --git a/board/keymile/kmcent2/kmcent2.c b/board/keymile/kmcent2/kmcent2.c
> index 783853d5c6f6..0f43ebfec4d5 100644
> --- a/board/keymile/kmcent2/kmcent2.c
> +++ b/board/keymile/kmcent2/kmcent2.c
> @@ -6,6 +6,7 @@
> * Copyright 2013 Freescale Semiconductor, Inc.
> */
>
> +#include <env.h>
> #include <event.h>
> #include <asm/cache.h>
> #include <asm/fsl_fdt.h>
> diff --git a/board/purism/librem5/librem5.c b/board/purism/librem5/librem5.c
> index 8ca8792fa422..5178ee6929d8 100644
> --- a/board/purism/librem5/librem5.c
> +++ b/board/purism/librem5/librem5.c
> @@ -6,6 +6,7 @@
>
> #include <malloc.h>
> #include <errno.h>
> +#include <env.h>
> #include <asm/io.h>
> #include <miiphy.h>
> #include <asm/mach-imx/iomux-v3.h>
> diff --git a/board/siemens/iot2050/board.c b/board/siemens/iot2050/board.c
> index d827f728a08c..161210c60a96 100644
> --- a/board/siemens/iot2050/board.c
> +++ b/board/siemens/iot2050/board.c
> @@ -11,6 +11,7 @@
> #include <config.h>
> #include <bootstage.h>
> #include <dm.h>
> +#include <env.h>
> #include <fdt_support.h>
> #include <i2c.h>
> #include <led.h>
> diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c
> index 0525f6e6f979..b1ed29af0018 100644
> --- a/board/ti/j721e/evm.c
> +++ b/board/ti/j721e/evm.c
> @@ -8,6 +8,7 @@
> */
>
> #include <efi_loader.h>
> +#include <env.h>
> #include <generic-phy.h>
> #include <image.h>
> #include <net.h>
> diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c
> index 0c9b4c3d59dc..0af23df3a4a5 100644
> --- a/boot/bootmeth_efi.c
> +++ b/boot/bootmeth_efi.c
> @@ -15,6 +15,7 @@
> #include <dm.h>
> #include <efi.h>
> #include <efi_loader.h>
> +#include <env.h>
> #include <fs.h>
> #include <malloc.h>
> #include <mapmem.h>
> diff --git a/boot/bootmeth_pxe.c b/boot/bootmeth_pxe.c
> index 6e5e0f99ea42..faa8d729b151 100644
> --- a/boot/bootmeth_pxe.c
> +++ b/boot/bootmeth_pxe.c
> @@ -13,6 +13,7 @@
> #include <bootmeth.h>
> #include <command.h>
> #include <dm.h>
> +#include <env.h>
> #include <extlinux.h>
> #include <fs.h>
> #include <log.h>
> diff --git a/cmd/pxe.c b/cmd/pxe.c
> index 0f26b3b42197..e82247af6c07 100644
> --- a/cmd/pxe.c
> +++ b/cmd/pxe.c
> @@ -5,6 +5,7 @@
> */
>
> #include <command.h>
> +#include <env.h>
> #include <fs.h>
> #include <net.h>
> #include <net6.h>
> diff --git a/drivers/net/pfe_eth/pfe_firmware.c b/drivers/net/pfe_eth/pfe_firmware.c
> index da4f2ca42a5b..b821fb17a1d6 100644
> --- a/drivers/net/pfe_eth/pfe_firmware.c
> +++ b/drivers/net/pfe_eth/pfe_firmware.c
> @@ -12,6 +12,7 @@
>
> #include <dm.h>
> #include <dm/device-internal.h>
> +#include <env.h>
> #include <image.h>
> #include <log.h>
> #include <malloc.h>
> diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c
> index c0df5cb9acd9..298149bcc332 100644
> --- a/lib/efi_loader/efi_bootmgr.c
> +++ b/lib/efi_loader/efi_bootmgr.c
> @@ -12,6 +12,7 @@
> #include <charset.h>
> #include <dm.h>
> #include <efi.h>
> +#include <env.h>
> #include <log.h>
> #include <malloc.h>
> #include <net.h>
> diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c
> index b3291b4f1d52..9db738ead9dd 100644
> --- a/lib/efi_loader/efi_net.c
> +++ b/lib/efi_loader/efi_net.c
> @@ -18,6 +18,7 @@
> #define LOG_CATEGORY LOGC_EFI
>
> #include <efi_loader.h>
> +#include <env.h>
> #include <dm.h>
> #include <linux/sizes.h>
> #include <malloc.h>
> diff --git a/net/lwip/dhcp.c b/net/lwip/dhcp.c
> index 92bd7067a7fb..043d2ab6e946 100644
> --- a/net/lwip/dhcp.c
> +++ b/net/lwip/dhcp.c
> @@ -3,6 +3,7 @@
>
> #include <command.h>
> #include <console.h>
> +#include <env.h>
> #include <log.h>
> #include <dm/device.h>
> #include <linux/delay.h>
> diff --git a/net/lwip/dns.c b/net/lwip/dns.c
> index 19172ac959ac..6862869d9e30 100644
> --- a/net/lwip/dns.c
> +++ b/net/lwip/dns.c
> @@ -3,6 +3,7 @@
>
> #include <command.h>
> #include <console.h>
> +#include <env.h>
> #include <lwip/dns.h>
> #include <lwip/timeouts.h>
> #include <net.h>
> diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c
> index f05c4cd3f64f..abc52b32049c 100644
> --- a/net/lwip/net-lwip.c
> +++ b/net/lwip/net-lwip.c
> @@ -3,6 +3,7 @@
> /* Copyright (C) 2024 Linaro Ltd. */
>
> #include <command.h>
> +#include <env.h>
> #include <dm/device.h>
> #include <dm/uclass.h>
> #include <hexdump.h>
> diff --git a/net/lwip/tftp.c b/net/lwip/tftp.c
> index 4f9b2049187c..56d27f821212 100644
> --- a/net/lwip/tftp.c
> +++ b/net/lwip/tftp.c
> @@ -6,6 +6,7 @@
> #include <display_options.h>
> #include <dm/device.h>
> #include <efi_loader.h>
> +#include <env.h>
> #include <image.h>
> #include <linux/delay.h>
> #include <lwip/apps/tftp_client.h>
> diff --git a/net/lwip/wget.c b/net/lwip/wget.c
> index a3b82908877f..46c16edcc440 100644
> --- a/net/lwip/wget.c
> +++ b/net/lwip/wget.c
> @@ -5,6 +5,7 @@
> #include <console.h>
> #include <display_options.h>
> #include <efi_loader.h>
> +#include <env.h>
> #include <image.h>
> #include <lwip/apps/http_client.h>
> #include "lwip/altcp_tls.h"
> diff --git a/test/dm/dsa.c b/test/dm/dsa.c
> index 9a31ae39d952..46e48741fbaa 100644
> --- a/test/dm/dsa.c
> +++ b/test/dm/dsa.c
> @@ -3,6 +3,7 @@
> * Copyright 2020-2021 NXP
> */
>
> +#include <env.h>
> #include <net/dsa.h>
> #include <dm/test.h>
> #include <test/ut.h>
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH v3 21/22] global: Avoid indirect inclusion of <env.h> from <net.h>
2025-05-15 23:31 ` [PATCH v3 21/22] global: Avoid indirect inclusion of <env.h> from <net.h> Tom Rini
2025-05-16 12:48 ` Jerome Forissier
2025-05-16 14:20 ` Martyn Welch
@ 2025-05-19 8:19 ` Wolfgang Wallner
2025-05-19 8:23 ` Ilias Apalodimas
3 siblings, 0 replies; 38+ messages in thread
From: Wolfgang Wallner @ 2025-05-19 8:19 UTC (permalink / raw)
To: Tom Rini, u-boot@lists.denx.de
Cc: Huan 'Kitty' Wang, Ying-Chun Liu (PaulLiu), Angus Ainslie,
Heinrich Schuchardt, Ian Ray, Ilias Apalodimas, Jan Kiszka,
Jerome Forissier, Joe Hershberger, Le Jin, Martyn Welch,
Niel Fourie, Ramon Fried, Rick Chen, Simon Glass, Tim Harvey,
Bernhard Messerklinger
> From: Tom Rini <trini@konsulko.com>
> Sent: Friday, May 16, 2025 1:31
> Subject: [PATCH v3 21/22] global: Avoid indirect inclusion of <env.h> from <net.h>
>
> Now that env_get_ip() has been removed, the include file <net.h> does
> not need anything from <env.h>. Furthermore, include/env.h itself
> includes other headers which can lead to longer indirect inclusion
> paths. To prepare to remove <env.h> from <net.h> fix all of the
> remaining places which had relied on this indirect inclusion to instead
> include <env.h> directly.
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> Changes in v3:
> - New patch
>
> Cc: "Huan 'Kitty' Wang" <HuanWang@gehealthcare.com>
> Cc: "Ying-Chun Liu (PaulLiu)" <paul.liu@linaro.org>
> Cc: Angus Ainslie <angus@akkea.ca> (supporter:PURISM LIBREM5 PHONE)
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Cc: Ian Ray <ian.ray@gehealthcare.com>
> Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> Cc: Jan Kiszka <jan.kiszka@siemens.com>
> Cc: Jerome Forissier <jerome.forissier@linaro.org>
> Cc: Joe Hershberger <joe.hershberger@ni.com>
> Cc: Le Jin <le.jin@siemens.com>
> Cc: Martyn Welch <martyn.welch@collabora.com>
> Cc: Niel Fourie <lusus@denx.de>
> Cc: Ramon Fried <rfried.dev@gmail.com>
> Cc: Rick Chen <rick@andestech.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Tim Harvey <tharvey@gateworks.com>
> Cc: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
> ---
> board/BuR/brppt2/board.c | 1 +
For brppt2/board.c:
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
> board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c | 1 +
> board/andestech/ae350/ae350.c | 1 +
> board/data_modul/common/common.c | 1 +
> board/gateworks/gw_ventana/gw_ventana.c | 1 +
> board/ge/b1x5v2/b1x5v2.c | 1 +
> board/keymile/kmcent2/kmcent2.c | 1 +
> board/purism/librem5/librem5.c | 1 +
> board/siemens/iot2050/board.c | 1 +
> board/ti/j721e/evm.c | 1 +
> boot/bootmeth_efi.c | 1 +
> boot/bootmeth_pxe.c | 1 +
> cmd/pxe.c | 1 +
> drivers/net/pfe_eth/pfe_firmware.c | 1 +
> lib/efi_loader/efi_bootmgr.c | 1 +
> lib/efi_loader/efi_net.c | 1 +
> net/lwip/dhcp.c | 1 +
> net/lwip/dns.c | 1 +
> net/lwip/net-lwip.c | 1 +
> net/lwip/tftp.c | 1 +
> net/lwip/wget.c | 1 +
> test/dm/dsa.c | 1 +
> 22 files changed, 22 insertions(+)
>
> diff --git a/board/BuR/brppt2/board.c b/board/BuR/brppt2/board.c
> index c0a163251b46..de206bdf1bc4 100644
> --- a/board/BuR/brppt2/board.c
> +++ b/board/BuR/brppt2/board.c
> @@ -7,6 +7,7 @@
> *
> */
> #include <cpu_func.h>
> +#include <env.h>
> #include <hang.h>
> #include <init.h>
> #include <spl.h>
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH v3 21/22] global: Avoid indirect inclusion of <env.h> from <net.h>
2025-05-15 23:31 ` [PATCH v3 21/22] global: Avoid indirect inclusion of <env.h> from <net.h> Tom Rini
` (2 preceding siblings ...)
2025-05-19 8:19 ` Wolfgang Wallner
@ 2025-05-19 8:23 ` Ilias Apalodimas
3 siblings, 0 replies; 38+ messages in thread
From: Ilias Apalodimas @ 2025-05-19 8:23 UTC (permalink / raw)
To: Tom Rini
Cc: u-boot, Huan 'Kitty' Wang, Ying-Chun Liu (PaulLiu),
Angus Ainslie, Heinrich Schuchardt, Ian Ray, Jan Kiszka,
Jerome Forissier, Joe Hershberger, Le Jin, Martyn Welch,
Niel Fourie, Ramon Fried, Rick Chen, Simon Glass, Tim Harvey,
Wolfgang Wallner
On Fri, 16 May 2025 at 02:42, Tom Rini <trini@konsulko.com> wrote:
>
> Now that env_get_ip() has been removed, the include file <net.h> does
> not need anything from <env.h>. Furthermore, include/env.h itself
> includes other headers which can lead to longer indirect inclusion
> paths. To prepare to remove <env.h> from <net.h> fix all of the
> remaining places which had relied on this indirect inclusion to instead
> include <env.h> directly.
>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> Changes in v3:
> - New patch
>
> Cc: "Huan 'Kitty' Wang" <HuanWang@gehealthcare.com>
> Cc: "Ying-Chun Liu (PaulLiu)" <paul.liu@linaro.org>
> Cc: Angus Ainslie <angus@akkea.ca> (supporter:PURISM LIBREM5 PHONE)
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Cc: Ian Ray <ian.ray@gehealthcare.com>
> Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> Cc: Jan Kiszka <jan.kiszka@siemens.com>
> Cc: Jerome Forissier <jerome.forissier@linaro.org>
> Cc: Joe Hershberger <joe.hershberger@ni.com>
> Cc: Le Jin <le.jin@siemens.com>
> Cc: Martyn Welch <martyn.welch@collabora.com>
> Cc: Niel Fourie <lusus@denx.de>
> Cc: Ramon Fried <rfried.dev@gmail.com>
> Cc: Rick Chen <rick@andestech.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Tim Harvey <tharvey@gateworks.com>
> Cc: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
> ---
> board/BuR/brppt2/board.c | 1 +
> board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c | 1 +
> board/andestech/ae350/ae350.c | 1 +
> board/data_modul/common/common.c | 1 +
> board/gateworks/gw_ventana/gw_ventana.c | 1 +
> board/ge/b1x5v2/b1x5v2.c | 1 +
> board/keymile/kmcent2/kmcent2.c | 1 +
> board/purism/librem5/librem5.c | 1 +
> board/siemens/iot2050/board.c | 1 +
> board/ti/j721e/evm.c | 1 +
> boot/bootmeth_efi.c | 1 +
> boot/bootmeth_pxe.c | 1 +
> cmd/pxe.c | 1 +
> drivers/net/pfe_eth/pfe_firmware.c | 1 +
> lib/efi_loader/efi_bootmgr.c | 1 +
> lib/efi_loader/efi_net.c | 1 +
> net/lwip/dhcp.c | 1 +
> net/lwip/dns.c | 1 +
> net/lwip/net-lwip.c | 1 +
> net/lwip/tftp.c | 1 +
> net/lwip/wget.c | 1 +
> test/dm/dsa.c | 1 +
> 22 files changed, 22 insertions(+)
>
> diff --git a/board/BuR/brppt2/board.c b/board/BuR/brppt2/board.c
> index c0a163251b46..de206bdf1bc4 100644
> --- a/board/BuR/brppt2/board.c
> +++ b/board/BuR/brppt2/board.c
> @@ -7,6 +7,7 @@
> *
> */
> #include <cpu_func.h>
> +#include <env.h>
> #include <hang.h>
> #include <init.h>
> #include <spl.h>
> diff --git a/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c b/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c
> index b9f47006d610..8c9e98308765 100644
> --- a/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c
> +++ b/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c
> @@ -7,6 +7,7 @@
> #include <dwc3-uboot.h>
> #include <efi.h>
> #include <efi_loader.h>
> +#include <env.h>
> #include <errno.h>
> #include <miiphy.h>
> #include <netdev.h>
> diff --git a/board/andestech/ae350/ae350.c b/board/andestech/ae350/ae350.c
> index 1d9d4a929c22..9bdd2ab17805 100644
> --- a/board/andestech/ae350/ae350.c
> +++ b/board/andestech/ae350/ae350.c
> @@ -6,6 +6,7 @@
>
> #include <config.h>
> #include <cpu_func.h>
> +#include <env.h>
> #include <flash.h>
> #include <image.h>
> #include <init.h>
> diff --git a/board/data_modul/common/common.c b/board/data_modul/common/common.c
> index 9e35dc5d6cb1..7d344792937e 100644
> --- a/board/data_modul/common/common.c
> +++ b/board/data_modul/common/common.c
> @@ -12,6 +12,7 @@
> #include <asm/mach-imx/boot_mode.h>
> #include <asm/mach-imx/iomux-v3.h>
> #include <dm/uclass.h>
> +#include <env.h>
> #include <hang.h>
> #include <i2c_eeprom.h>
> #include <image.h>
> diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c
> index 21a908c20dd5..457d8281a664 100644
> --- a/board/gateworks/gw_ventana/gw_ventana.c
> +++ b/board/gateworks/gw_ventana/gw_ventana.c
> @@ -6,6 +6,7 @@
> */
>
> #include <command.h>
> +#include <env.h>
> #include <fdt_support.h>
> #include <gsc.h>
> #include <hwconfig.h>
> diff --git a/board/ge/b1x5v2/b1x5v2.c b/board/ge/b1x5v2/b1x5v2.c
> index c1aacd1458b1..ddb7304d493a 100644
> --- a/board/ge/b1x5v2/b1x5v2.c
> +++ b/board/ge/b1x5v2/b1x5v2.c
> @@ -17,6 +17,7 @@
> #include <asm/io.h>
> #include <asm/mach-imx/video.h>
> #include <command.h>
> +#include <env.h>
> #include <i2c.h>
> #include <input.h>
> #include <ipu_pixfmt.h>
> diff --git a/board/keymile/kmcent2/kmcent2.c b/board/keymile/kmcent2/kmcent2.c
> index 783853d5c6f6..0f43ebfec4d5 100644
> --- a/board/keymile/kmcent2/kmcent2.c
> +++ b/board/keymile/kmcent2/kmcent2.c
> @@ -6,6 +6,7 @@
> * Copyright 2013 Freescale Semiconductor, Inc.
> */
>
> +#include <env.h>
> #include <event.h>
> #include <asm/cache.h>
> #include <asm/fsl_fdt.h>
> diff --git a/board/purism/librem5/librem5.c b/board/purism/librem5/librem5.c
> index 8ca8792fa422..5178ee6929d8 100644
> --- a/board/purism/librem5/librem5.c
> +++ b/board/purism/librem5/librem5.c
> @@ -6,6 +6,7 @@
>
> #include <malloc.h>
> #include <errno.h>
> +#include <env.h>
> #include <asm/io.h>
> #include <miiphy.h>
> #include <asm/mach-imx/iomux-v3.h>
> diff --git a/board/siemens/iot2050/board.c b/board/siemens/iot2050/board.c
> index d827f728a08c..161210c60a96 100644
> --- a/board/siemens/iot2050/board.c
> +++ b/board/siemens/iot2050/board.c
> @@ -11,6 +11,7 @@
> #include <config.h>
> #include <bootstage.h>
> #include <dm.h>
> +#include <env.h>
> #include <fdt_support.h>
> #include <i2c.h>
> #include <led.h>
> diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c
> index 0525f6e6f979..b1ed29af0018 100644
> --- a/board/ti/j721e/evm.c
> +++ b/board/ti/j721e/evm.c
> @@ -8,6 +8,7 @@
> */
>
> #include <efi_loader.h>
> +#include <env.h>
> #include <generic-phy.h>
> #include <image.h>
> #include <net.h>
> diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c
> index 0c9b4c3d59dc..0af23df3a4a5 100644
> --- a/boot/bootmeth_efi.c
> +++ b/boot/bootmeth_efi.c
> @@ -15,6 +15,7 @@
> #include <dm.h>
> #include <efi.h>
> #include <efi_loader.h>
> +#include <env.h>
> #include <fs.h>
> #include <malloc.h>
> #include <mapmem.h>
> diff --git a/boot/bootmeth_pxe.c b/boot/bootmeth_pxe.c
> index 6e5e0f99ea42..faa8d729b151 100644
> --- a/boot/bootmeth_pxe.c
> +++ b/boot/bootmeth_pxe.c
> @@ -13,6 +13,7 @@
> #include <bootmeth.h>
> #include <command.h>
> #include <dm.h>
> +#include <env.h>
> #include <extlinux.h>
> #include <fs.h>
> #include <log.h>
> diff --git a/cmd/pxe.c b/cmd/pxe.c
> index 0f26b3b42197..e82247af6c07 100644
> --- a/cmd/pxe.c
> +++ b/cmd/pxe.c
> @@ -5,6 +5,7 @@
> */
>
> #include <command.h>
> +#include <env.h>
> #include <fs.h>
> #include <net.h>
> #include <net6.h>
> diff --git a/drivers/net/pfe_eth/pfe_firmware.c b/drivers/net/pfe_eth/pfe_firmware.c
> index da4f2ca42a5b..b821fb17a1d6 100644
> --- a/drivers/net/pfe_eth/pfe_firmware.c
> +++ b/drivers/net/pfe_eth/pfe_firmware.c
> @@ -12,6 +12,7 @@
>
> #include <dm.h>
> #include <dm/device-internal.h>
> +#include <env.h>
> #include <image.h>
> #include <log.h>
> #include <malloc.h>
> diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c
> index c0df5cb9acd9..298149bcc332 100644
> --- a/lib/efi_loader/efi_bootmgr.c
> +++ b/lib/efi_loader/efi_bootmgr.c
> @@ -12,6 +12,7 @@
> #include <charset.h>
> #include <dm.h>
> #include <efi.h>
> +#include <env.h>
> #include <log.h>
> #include <malloc.h>
> #include <net.h>
> diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c
> index b3291b4f1d52..9db738ead9dd 100644
> --- a/lib/efi_loader/efi_net.c
> +++ b/lib/efi_loader/efi_net.c
> @@ -18,6 +18,7 @@
> #define LOG_CATEGORY LOGC_EFI
>
> #include <efi_loader.h>
> +#include <env.h>
> #include <dm.h>
> #include <linux/sizes.h>
> #include <malloc.h>
> diff --git a/net/lwip/dhcp.c b/net/lwip/dhcp.c
> index 92bd7067a7fb..043d2ab6e946 100644
> --- a/net/lwip/dhcp.c
> +++ b/net/lwip/dhcp.c
> @@ -3,6 +3,7 @@
>
> #include <command.h>
> #include <console.h>
> +#include <env.h>
> #include <log.h>
> #include <dm/device.h>
> #include <linux/delay.h>
> diff --git a/net/lwip/dns.c b/net/lwip/dns.c
> index 19172ac959ac..6862869d9e30 100644
> --- a/net/lwip/dns.c
> +++ b/net/lwip/dns.c
> @@ -3,6 +3,7 @@
>
> #include <command.h>
> #include <console.h>
> +#include <env.h>
> #include <lwip/dns.h>
> #include <lwip/timeouts.h>
> #include <net.h>
> diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c
> index f05c4cd3f64f..abc52b32049c 100644
> --- a/net/lwip/net-lwip.c
> +++ b/net/lwip/net-lwip.c
> @@ -3,6 +3,7 @@
> /* Copyright (C) 2024 Linaro Ltd. */
>
> #include <command.h>
> +#include <env.h>
> #include <dm/device.h>
> #include <dm/uclass.h>
> #include <hexdump.h>
> diff --git a/net/lwip/tftp.c b/net/lwip/tftp.c
> index 4f9b2049187c..56d27f821212 100644
> --- a/net/lwip/tftp.c
> +++ b/net/lwip/tftp.c
> @@ -6,6 +6,7 @@
> #include <display_options.h>
> #include <dm/device.h>
> #include <efi_loader.h>
> +#include <env.h>
> #include <image.h>
> #include <linux/delay.h>
> #include <lwip/apps/tftp_client.h>
> diff --git a/net/lwip/wget.c b/net/lwip/wget.c
> index a3b82908877f..46c16edcc440 100644
> --- a/net/lwip/wget.c
> +++ b/net/lwip/wget.c
> @@ -5,6 +5,7 @@
> #include <console.h>
> #include <display_options.h>
> #include <efi_loader.h>
> +#include <env.h>
> #include <image.h>
> #include <lwip/apps/http_client.h>
> #include "lwip/altcp_tls.h"
> diff --git a/test/dm/dsa.c b/test/dm/dsa.c
> index 9a31ae39d952..46e48741fbaa 100644
> --- a/test/dm/dsa.c
> +++ b/test/dm/dsa.c
> @@ -3,6 +3,7 @@
> * Copyright 2020-2021 NXP
> */
>
> +#include <env.h>
> #include <net/dsa.h>
> #include <dm/test.h>
> #include <test/ut.h>
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH v3 22/22] include/net.h: Drop <env.h>
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
` (20 preceding siblings ...)
2025-05-15 23:31 ` [PATCH v3 21/22] global: Avoid indirect inclusion of <env.h> from <net.h> Tom Rini
@ 2025-05-15 23:31 ` Tom Rini
2025-05-29 17:55 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
22 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-15 23:31 UTC (permalink / raw)
To: u-boot
Now that all of the cases of code that relied on <net.h> to provide
<env.h> (or one of the headers that it includes, and so forth) have been
fixed, we can drop the include from here.
Signed-off-by: Tom Rini <trini@konsulko.com>
---
Changes in v3:
- New patch
---
include/net-common.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/include/net-common.h b/include/net-common.h
index 2ca565fe4edc..9e82b280df2c 100644
--- a/include/net-common.h
+++ b/include/net-common.h
@@ -5,7 +5,6 @@
#include <asm/cache.h>
#include <command.h>
-#include <env.h>
#include <hexdump.h>
#include <linux/if_ether.h>
#include <linux/sizes.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* Re: [PATCH v3 00/22] Remove <env.h> from <net.h>
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
` (21 preceding siblings ...)
2025-05-15 23:31 ` [PATCH v3 22/22] include/net.h: Drop <env.h> Tom Rini
@ 2025-05-29 17:55 ` Tom Rini
22 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-29 17:55 UTC (permalink / raw)
To: u-boot, Tom Rini
On Thu, 15 May 2025 17:31:29 -0600, Tom Rini wrote:
> Hey all,
>
> This is a v3 of Simon's series[1] and depends on the series[2] I posted
> the other day that removes <env.h> from <command.h>. With this series
> done, I believe we've tackled all of the current cases of headers which
> include <env.h> without directly needing it. Much of this series is in
> fact Simon's v2 with the main differneces being:
> - Removing <env.h> from <net.h> at the end
> - Removing env_to_ip() given how little it's used rather than shuffling
> around where it's declared and un-inline'ing it. For a rarely used
> helper, this ends up being cleaner I think. Especially looking at some
> of the users (which called env_get repeatedly). If there's strong
> opinion here about using the other method[3] we can do that instead.
> - Setting aside for now how to handle CMD_ELF=y and NO_NET=y because
> today it's actually fine as we unconditionally build lib/net_utils.c
> where string_to_ip() is defined. I'm unsure if a further series is
> warranted here or not. We rely on link-time optimization to keep code
> readable too.
>
> [...]
Applied to u-boot/next, thanks!
[01/22] net: Remove env_get_ip helper() function
commit: 05f6f6e8c76c68a36125ec7a6af911ee9418bc99
[02/22] congatec: Include env.h to permit reading the environment
commit: 67a7633e04d71c61018d857f27d18e05acc5b844
[03/22] dhelectronics: Include env.h to permit reading the environment
commit: 09c9957e8808b6a3513450c802d43c9410a14368
[04/22] imx8ulp_evk: Include env.h to permit reading the environment
commit: 84a1c99055166857efabe55277f01341404e8dda
[05/22] net: Include string.h in net-legacy.h
commit: 0b9450989c195430521b01d97ba79a9b644119a6
[06/22] venice: Include env.h to permit reading the environment
commit: 600145a8e10418d26f43045f9452610e39ce6f38
[07/22] phytec: Include env.h to permit reading the environment
commit: b4135116116a318113968ce9f8f72c711d09dd28
[08/22] ronetix: Include env.h to permit reading the environment
commit: 6e898e332b0e7e11ebeb83bdbfcd9e3e1600817a
[09/22] toradex: Include env.h to permit reading the environment
commit: bcf10f16ea41cd690be59a88d8e7292881d01e56
[10/22] advantech: Include env.h in imx8qm_dmsse20_a1
commit: 0f8a4a9c4427370c5f20b8ffcbd615fb9658921e
[11/22] tegra: Include env.h to permit reading the environment
commit: 433e86abea7e8b570ee0ad89842ac806511d1b94
[12/22] synology: Include env.h to permit reading the environment
commit: f24a197973ad0c5f473401b16a801794f2764678
[13/22] amlogic: Include env.h to permit reading the environment
commit: 6d9d6ba71ab9391e5fb163634bfb1cc65987cdd4
[14/22] freescale: Include env.h to permit reading the environment
commit: 2876ff79b257667438ae7a6132d5ce750ec501ac
[15/22] google: Include env.h to permit reading the environment
commit: 98faae1617b44e53c475adf8552245691e1f05fb
[16/22] liebherr: Include env.h to permit reading the environment
commit: ea9afef22d49a4ac12484e01fd459e225da790b7
[17/22] technexion: Include env.h to permit reading the environment
commit: 7b612cfa757a44d1bdee6d087e24e2e5c9d8a868
[18/22] net: Include byteorder in net6.h
commit: 22d4e22a3d2e8a95c37c0635701daaee8d5a5c6b
[19/22] net: Include env.h in pcap.c
commit: 85b013e3f43ff4fa50ced6a23ba336813eaf9320
[20/22] net: dc2114x: Include env.h to permit reading the environment
commit: 183d88cdfc19ea7bd56af69512f0d1425de73e77
[21/22] global: Avoid indirect inclusion of <env.h> from <net.h>
commit: ae9ff5ae6f579f321a1b695c82453b67ec1bf6db
[22/22] include/net.h: Drop <env.h>
commit: fe33175c073fe21945b39a4a8c27806cf0154bf3
--
Tom
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 0/5] Start removing <env.h> from headers when not required
2025-05-14 22:45 [PATCH 0/5] Start removing <env.h> from headers when not required Tom Rini
` (5 preceding siblings ...)
2025-05-15 23:31 ` [PATCH v3 00/22] Remove <env.h> from <net.h> Tom Rini
@ 2025-05-29 17:55 ` Tom Rini
6 siblings, 0 replies; 38+ messages in thread
From: Tom Rini @ 2025-05-29 17:55 UTC (permalink / raw)
To: u-boot, Tom Rini
On Wed, 14 May 2025 16:45:59 -0600, Tom Rini wrote:
> Hey all,
>
> Given Simon's series at [1] I started looking in to what brings in
> <env.h> when not strictly required and in turn has some unintended
> implicit includes. This series takes care of the places where, commonly,
> <linux/string.h> or <env.h> itself were required along with a few other
> less common cases. This sets aside for the moment what to do about
> net-common.h and env_get_ip() as I'm not entirely sure what's best
> there.
>
> [...]
Applied to u-boot/next, thanks!
[1/5] global: Add <linux/string.h> instead of long indirect include path
commit: 64307118499db0be83db29cfcbd8860db1e44e37
[2/5] cmd/mem.c, test/cmd/mem_copy.c: Add <compiler.h>
commit: 55717ca66f10bd8c1c05cd8053fee233d869e7e5
[3/5] gpio: pca953x: Add missing <asm/byteorder.h>
commit: d0e1ee6590420ec13cfe3fa373679054ac08a184
[4/5] global: Avoid indirect inclusion of <env.h> from <command.h>
commit: dcb7d927d181b5798c6fd4a1b1650cd821e3b6ed
[5/5] include/command.h: Drop <env.h>
commit: 1e50f7457fcaaba2caf642132cf4f00f1eba29a9
--
Tom
^ permalink raw reply [flat|nested] 38+ messages in thread