Start removing <env.h> from headers when not required
Subsystems (14)
cover Start removing <env.h> from headers when not required
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.
[1]: https://patchwork.ozlabs.org/project/uboot/list/?series=454939&state=*
Signature · 1 line
Tom
PATCH 1/5 global: Add <linux/string.h> instead of long indirect include path
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>.
---
Cc: Andrew Davis <[email protected]>
Cc: Bin Meng <[email protected]>
Cc: Dai Okamura <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Francesco Dolcini <[email protected]>
Cc: Ilias Apalodimas <[email protected]>
Cc: Jens Wiklander <[email protected]>
Cc: Kunihiko Hayashi <[email protected]>
Cc: Mingkai Hu <[email protected]>
Cc: Priyanka Jain <[email protected]>
Cc: Shengzhou Liu <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Stefano Babic <[email protected]>
Cc: Svyatoslav Ryhel <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: William Zhang <[email protected]>
--- 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(+)
arch/arm/mach-imx/mx5/clock.c +1 -0
@@ -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>
arch/arm/mach-keystone/cmd_clock.c +1 -0
@@ -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>
arch/arm/mach-tegra/tegra124/bct.c +1 -0
@@ -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"
arch/arm/mach-tegra/tegra20/bct.c +1 -0
@@ -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"
arch/arm/mach-tegra/tegra30/bct.c +1 -0
@@ -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"
arch/arm/mach-uniphier/dram/cmd_ddrmphy.c +1 -0
@@ -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"
arch/arm/mach-uniphier/dram/cmd_ddrphy.c +1 -0
@@ -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"
board/freescale/common/qixis.c +1 -0
@@ -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"
board/freescale/ls1043ardb/cpld.c +1 -0
@@ -7,6 +7,7 @@#include <config.h> #include <command.h> +#include <linux/string.h> #include <asm/io.h> #include "cpld.h"
board/freescale/ls1046ardb/cpld.c +1 -0
@@ -7,6 +7,7 @@#include <config.h> #include <command.h> +#include <linux/string.h> #include <asm/io.h> #include "cpld.h"
board/freescale/p2041rdb/cpld.c +1 -0
@@ -12,6 +12,7 @@*/ #include <command.h> +#include <linux/string.h> #include <asm/io.h> #include "cpld.h"
board/freescale/t102xrdb/cpld.c +1 -0
@@ -9,6 +9,7 @@#include <config.h> #include <command.h> +#include <linux/string.h> #include <asm/io.h> #include "cpld.h"
board/freescale/t104xrdb/cpld.c +1 -0
@@ -12,6 +12,7 @@#include <config.h> #include <command.h> +#include <linux/string.h> #include <asm/io.h> #include "cpld.h"
board/freescale/t208xrdb/cpld.c +1 -0
@@ -7,6 +7,7 @@#include <config.h> #include <command.h> +#include <linux/string.h> #include <asm/io.h> #include "cpld.h"
board/freescale/t4rdb/cpld.c +1 -0
@@ -16,6 +16,7 @@#include <config.h> #include <command.h> +#include <linux/string.h> #include <asm/io.h> #include "cpld.h"
board/toradex/apalis_imx6/do_fuse.c +1 -0
@@ -11,6 +11,7 @@#include <command.h> #include <console.h> #include <fuse.h> +#include <linux/string.h> static int mfgr_fuse (void ) {
board/toradex/colibri_imx6/do_fuse.c +1 -0
@@ -11,6 +11,7 @@#include <command.h> #include <console.h> #include <fuse.h> +#include <linux/string.h> static int mfgr_fuse (void ) {
boot/image-pre-load.c +1 -0
@@ -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*/
cmd/2048.c +1 -0
@@ -8,6 +8,7 @@#include <rand.h> #include <vsprintf.h> #include <linux/delay.h> +#include <linux/string.h> #define SIZE 4static uint score;
cmd/armflash.c +1 -0
@@ -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
cmd/bootstage.c +1 -0
@@ -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[])
cmd/cache.c +1 -0
@@ -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 *);
cmd/diag.c +1 -0
@@ -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[]) {
cmd/dm.c +1 -0
@@ -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[])
cmd/echo.c +1 -0
@@ -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[])
cmd/flash.c +1 -0
@@ -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 )
cmd/fuse.c +1 -0
@@ -14,6 +14,7 @@#include <mapmem.h> #include <vsprintf.h> #include <linux/errno.h> +#include <linux/string.h> static int confirm_prog (void ) {
cmd/irq.c +1 -0
@@ -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[])
cmd/legacy_led.c +1 -0
@@ -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 */
cmd/mp.c +1 -0
@@ -6,6 +6,7 @@#include <command.h> #include <cpu_func.h> #include <vsprintf.h> +#include <linux/string.h> static int cpu_status_all (void ) {
cmd/optee.c +1 -0
@@ -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. */
cmd/sha1sum.c +1 -0
@@ -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[])
cmd/sleep.c +1 -0
@@ -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[])
cmd/smccc.c +1 -0
@@ -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[])
cmd/stackprot_test.c +1 -0
@@ -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[])
cmd/strings.c +1 -0
@@ -9,6 +9,7 @@#include <config.h> #include <command.h> #include <vsprintf.h> +#include <linux/string.h> static char *start_addr, *last_addr;
cmd/test.c +1 -0
@@ -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
cmd/timer.c +1 -0
@@ -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[])
cmd/ufs.c +1 -0
@@ -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[]) {
cmd/x86/mtrr.c +1 -0
@@ -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>
drivers/tpm/sandbox_common.c +1 -0
@@ -9,6 +9,7 @@#include <tpm-v1.h> #include <tpm-v2.h> +#include <linux/string.h> #include <asm/unaligned.h> #include "sandbox_common.h"
Signature · 1 line
2.43.0
PATCH 2/5 cmd/mem.c, test/cmd/mem_copy.c: Add <compiler.h>
In reply to Tom RiniThese 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.
--- cmd/mem.c | 1 + test/cmd/mem_copy.c | 1 + 2 files changed, 2 insertions(+)
cmd/mem.c +1 -0
@@ -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
test/cmd/mem_copy.c +1 -0
@@ -4,6 +4,7 @@*/ #include <command.h> +#include <compiler.h> #include <console.h> #include <mapmem.h> #include <dm/test.h>
Signature · 1 line
2.43.0
PATCH 3/5 gpio: pca953x: Add missing <asm/byteorder.h>
In reply to Tom RiniThis driver takes a long implicit include path to get this header which it directly uses. Add it.
--- drivers/gpio/pca953x.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpio/pca953x.c +1 -0
@@ -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
Signature · 1 line
2.43.0
PATCH 4/5 global: Avoid indirect inclusion of <env.h> from <command.h>
In reply to Tom RiniThe 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.
---
Cc: Anatolij Gustschin <[email protected]>
Cc: Bin Meng <[email protected]>
Cc: Heinrich Schuchardt <[email protected]>
Cc: Ilias Apalodimas <[email protected]>
Cc: Jaehoon Chung <[email protected]>
Cc: Jerome Forissier <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Lukasz Majewski <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Mark Kettenis <[email protected]>
Cc: Masahisa Kojima <[email protected]>
Cc: Mattijs Korpershoek <[email protected]>
Cc: Patrice Chotard <[email protected]>
Cc: Patrick Delaunay <[email protected]>
Cc: Rayagonda Kokatanur <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Simon Goldschmidt <[email protected]>
Cc: Stefan Bosch <[email protected]>
Cc: Tien Fong Chee <[email protected]>
Cc: Tingting Meng <[email protected]>
Cc: Tobias Waldekranz <[email protected]>
--- 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(+)
arch/arm/cpu/armv8/fsl-layerscape/fdt.c +1 -0
@@ -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>
arch/arm/mach-apple/board.c +1 -0
@@ -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>
arch/arm/mach-k3/r5/common.c +1 -0
@@ -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>
arch/arm/mach-socfpga/board.c +1 -0
@@ -7,6 +7,7 @@#include <config.h> #include <errno.h> +#include <env.h> #include <fdtdec.h> #include <log.h> #include <init.h>
arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c +1 -0
@@ -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>
board/liebherr/mccmon6/spl.c +1 -0
@@ -5,6 +5,7 @@* Richard Hu <[email protected]> */ +#include <env.h> #include <image.h> #include <init.h> #include <asm/arch/clock.h>
board/siemens/common/board_am335x.c +1 -0
@@ -10,6 +10,7 @@*/ #include <command.h> +#include <env.h> #include <serial.h> #include <watchdog.h> #include <asm/arch/clock.h>
board/socionext/developerbox/fwu_plat.c +1 -0
@@ -4,6 +4,7 @@*/ #include <efi_loader.h> +#include <env.h> #include <fwu.h> #include <fwu_mdata.h> #include <memalign.h>
boot/bootmeth_android.c +1 -0
@@ -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>
cmd/abootimg.c +1 -0
@@ -6,6 +6,7 @@#include <android_image.h> #include <command.h> +#include <env.h> #include <image.h> #include <mapmem.h>
cmd/adc.c +1 -0
@@ -5,6 +5,7 @@*/ #include <command.h> #include <dm.h> +#include <env.h> #include <adc.h> #include <linux/printk.h>
cmd/armflash.c +1 -0
@@ -7,6 +7,7 @@*/ #include <command.h> #include <console.h> +#include <env.h> #include <flash.h> #include <vsprintf.h> #include <linux/string.h>
cmd/bcb.c +1 -0
@@ -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>
cmd/blkmap.c +1 -0
@@ -7,6 +7,7 @@#include <blk.h> #include <blkmap.h> #include <command.h> +#include <env.h> #include <malloc.h> #include <dm/device.h>
cmd/bootflow.c +1 -0
@@ -13,6 +13,7 @@#include <command.h> #include <console.h> #include <dm.h> +#include <env.h> #include <mapmem.h> /**
cmd/booti.c +1 -0
@@ -6,6 +6,7 @@#include <bootm.h> #include <command.h> +#include <env.h> #include <image.h> #include <irq_func.h> #include <lmb.h>
cmd/bootmeth.c +1 -0
@@ -11,6 +11,7 @@#include <bootstd.h> #include <command.h> #include <dm.h> +#include <env.h> #include <malloc.h> #include <dm/uclass-internal.h>
cmd/broadcom/nitro_image_load.c +1 -0
@@ -4,6 +4,7 @@*/ #include <command.h> +#include <env.h> #include <vsprintf.h> #define FW_IMAGE_SIG 0xff123456
cmd/extension_board.c +1 -0
@@ -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>
cmd/hash.c +1 -0
@@ -10,6 +10,7 @@*/ #include <command.h> +#include <env.h> #include <hash.h> #include <linux/ctype.h>
cmd/mbr.c +1 -0
@@ -10,6 +10,7 @@#include <blk.h> #include <command.h> +#include <env.h> #include <malloc.h> #include <part.h> #include <vsprintf.h>
cmd/mem.c +1 -0
@@ -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
cmd/mmc.c +1 -0
@@ -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>
cmd/sandbox/exception.c +1 -0
@@ -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[])
cmd/seama.c +1 -0
@@ -5,6 +5,7 @@*/ #include <command.h> +#include <env.h> #include <nand.h> /*
cmd/spawn.c +1 -0
@@ -5,6 +5,7 @@#include <command.h> #include <console.h> +#include <env.h> #include <malloc.h> #include <vsprintf.h> #include <uthread.h>
cmd/upl.c +1 -0
@@ -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>
cmd/x86/zboot.c +1 -0
@@ -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>
common/usb.c +1 -0
@@ -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>
drivers/power/axp221.c +1 -0
@@ -10,6 +10,7 @@*/ #include <command.h> +#include <env.h> #include <errno.h> #include <asm/arch/pmic_bus.h> #include <axp_pmic.h>
drivers/video/nexell_display.c +1 -0
@@ -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>
lib/efi_loader/efi_firmware.c +1 -0
@@ -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>
test/boot/bootdev.c +1 -0
@@ -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>
test/boot/bootflow.c +1 -0
@@ -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
test/boot/bootm.c +1 -0
@@ -6,6 +6,7 @@*/ #include <bootm.h> +#include <env.h> #include <asm/global_data.h> #include <test/test.h> #include <test/ut.h>
test/boot/bootmeth.c +1 -0
@@ -9,6 +9,7 @@#include <bootmeth.h> #include <bootstd.h> #include <dm.h> +#include <env.h> #include <test/ut.h> #include "bootstd_common.h"
test/boot/measurement.c +1 -0
@@ -7,6 +7,7 @@*/ #include <bootm.h> +#include <env.h> #include <malloc.h> #include <test/test.h> #include <test/ut.h>
test/boot/upl.c +1 -0
@@ -7,6 +7,7 @@*/ #include <abuf.h> +#include <env.h> #include <mapmem.h> #include <upl.h> #include <dm/ofnode.h>
test/cmd/fdt.c +1 -0
@@ -6,6 +6,7 @@*/ #include <console.h> +#include <env.h> #include <fdt_support.h> #include <mapmem.h> #include <asm/global_data.h>
test/cmd/hash.c +1 -0
@@ -6,6 +6,7 @@*/ #include <command.h> +#include <env.h> #include <dm.h> #include <dm/test.h> #include <test/test.h>
test/cmd/mem_search.c +1 -0
@@ -7,6 +7,7 @@*/ #include <console.h> +#include <env.h> #include <mapmem.h> #include <dm/test.h> #include <test/ut.h>
test/cmd/setexpr.c +1 -0
@@ -7,6 +7,7 @@*/ #include <console.h> +#include <env.h> #include <mapmem.h> #include <dm/test.h> #include <test/ut.h>
test/common/test_autoboot.c +1 -0
@@ -6,6 +6,7 @@*/ #include <autoboot.h> +#include <env.h> #include <test/common.h> #include <test/test.h> #include <test/ut.h>
test/dm/blkmap.c +1 -0
@@ -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>
test/dm/button.c +1 -0
@@ -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>
test/dm/fastboot.c +1 -0
@@ -4,6 +4,7 @@*/ #include <dm.h> +#include <env.h> #include <fastboot.h> #include <fb_mmc.h> #include <mmc.h>
test/dm/part.c +1 -0
@@ -4,6 +4,7 @@*/ #include <dm.h> +#include <env.h> #include <mmc.h> #include <part.h> #include <part_efi.h>
test/env/fdt.c +1 -0
@@ -1,4 +1,5 @@#include <command.h> +#include <env.h> #include <env_attr.h> #include <test/env.h> #include <test/ut.h>
test/hush/dollar.c +1 -0
@@ -5,6 +5,7 @@*/ #include <command.h> +#include <env.h> #include <env_attr.h> #include <test/hush.h> #include <test/ut.h>
test/hush/if.c +1 -0
@@ -5,6 +5,7 @@*/ #include <command.h> +#include <env.h> #include <env_attr.h> #include <vsprintf.h> #include <test/hush.h>
test/hush/loop.c +1 -0
@@ -5,6 +5,7 @@*/ #include <command.h> +#include <env.h> #include <env_attr.h> #include <test/hush.h> #include <test/ut.h>
Signature · 1 line
2.43.0
Re: [PATCH 4/5] global: Avoid indirect inclusion of <env.h> from <command.h>
Hi Tom,
Thank you for the patch.
Quoted 7 lines · Tom Rini
The include file <
command.h> does not need anything from <env.h>. Furthermore,include/env.hitself 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 <[email protected]>
Quoted 1 line
---
Re: [PATCH 4/5] global: Avoid indirect inclusion of <env.h> from <command.h>
In reply to Tom RiniQuoted 7 lines · Tom Rini
The include file <
command.h> does not need anything from <env.h>. Furthermore,include/env.hitself 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 <[email protected]>
Thanks,
Signature · 1 line
Jerome
PATCH 5/5 include/command.h: Drop <env.h>
In reply to Tom RiniNow 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.
--- include/command.h | 1 - 1 file changed, 1 deletion(-)
include/command.h +0 -1
@@ -10,7 +10,6 @@#ifndef __COMMAND_H#define __COMMAND_H -#include <env.h> #include <linker_lists.h> #include <linux/compiler_attributes.h>
Signature · 1 line
2.43.0
v3 cover Remove <env.h> from <net.h>
In reply to Tom RiniHey 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/[email protected]
[2]: https://lore.kernel.org/all/[email protected]
[3]: https://lore.kernel.org/all/[email protected]
Signature · 1 line
Tom
PATCH v3 1/22 net: Remove env_get_ip helper() function
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.
---
Changes in v3:
- New patch
--- 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(-)
cmd/elf.c +1 -1
@@ -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 {
cmd/net.c +1 -1
@@ -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 ;
drivers/net/netconsole.c +6 -5
@@ -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;
include/net-common.h +0 -13
@@ -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 */
net/link_local.c +1 -1
@@ -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" );
Signature · 1 line
2.43.0
PATCH v3 2/22 congatec: Include env.h to permit reading the environment
In reply to Tom RiniFrom: Simon Glass <[email protected]>
This file reads from the environment but does not include the correct header. Update it.
---
Changes in v3:
- Keep config.h, update commit message - trini
--- board/congatec/cgtqmx8/cgtqmx8.c | 1 + 1 file changed, 1 insertion(+)
board/congatec/cgtqmx8/cgtqmx8.c +1 -0
@@ -4,6 +4,7 @@* Copyright (C) 2019 Oliver Graute <[email protected]> */ #include <config.h> +#include <env.h> #include <errno.h> #include <linux/libfdt.h> #include <fsl_esdhc.h>
Signature · 1 line
2.43.0
PATCH v3 3/22 dhelectronics: Include env.h to permit reading the environment
In reply to Tom RiniFrom: Simon Glass <[email protected]>
This file reads from the environment but does not include the correct header. Update it.
---
Changes in v3:
- None
--- board/dhelectronics/common/dh_common.c | 1 + 1 file changed, 1 insertion(+)
board/dhelectronics/common/dh_common.c +1 -0
@@ -5,6 +5,7 @@*/ #include <dm.h> +#include <env.h> #include <i2c_eeprom.h> #include <net.h> #include <u-boot/crc.h>
Signature · 1 line
2.43.0
PATCH v3 4/22 imx8ulp_evk: Include env.h to permit reading the environment
In reply to Tom RiniFrom: Simon Glass <[email protected]>
This file reads from the environment but does not include the correct header. Update it.
---
Changes in v3:
- None
--- board/freescale/imx8ulp_evk/imx8ulp_evk.c | 1 + 1 file changed, 1 insertion(+)
board/freescale/imx8ulp_evk/imx8ulp_evk.c +1 -0
@@ -3,6 +3,7 @@* Copyright 2020 NXP */ +#include <env.h> #include <miiphy.h> #include <netdev.h> #include <asm/arch/imx8ulp-pins.h>
Signature · 1 line
2.43.0
PATCH v3 5/22 net: Include string.h in net-legacy.h
In reply to Tom RiniFrom: Simon Glass <[email protected]>
This file uses memcpy() but does not include the header file. Update it.
---
Changes in v3:
- None
--- include/net-legacy.h | 1 + 1 file changed, 1 insertion(+)
include/net-legacy.h +1 -0
@@ -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 ;
Signature · 1 line
2.43.0
PATCH v3 6/22 venice: Include env.h to permit reading the environment
In reply to Tom RiniFrom: Simon Glass <[email protected]>
This file reads from the environment but does not include the correct header. Update it.
---
Changes in v3:
- None
--- board/gateworks/venice/venice.c | 1 + 1 file changed, 1 insertion(+)
board/gateworks/venice/venice.c +1 -0
@@ -3,6 +3,7 @@* Copyright 2021 Gateworks Corporation */ +#include <env.h> #include <fdt_support.h> #include <init.h> #include <led.h>
Signature · 1 line
2.43.0
PATCH v3 7/22 phytec: Include env.h to permit reading the environment
In reply to Tom RiniFrom: Simon Glass <[email protected]>
This file reads from the environment but does not include the correct header. Update it.
---
Changes in v3:
- None
--- board/phytec/common/phytec_som_detection_blocks.c | 1 + 1 file changed, 1 insertion(+)
board/phytec/common/phytec_som_detection_blocks.c +1 -0
@@ -4,6 +4,7 @@* Author: Daniel Schultz <[email protected]> */ +#include <env.h> #include <malloc.h> #include <u-boot/crc.h> #include <net.h>
Signature · 1 line
2.43.0
PATCH v3 8/22 ronetix: Include env.h to permit reading the environment
In reply to Tom RiniFrom: Simon Glass <[email protected]>
This file reads from the environment but does not include the correct header. Update it.
---
Changes in v3:
- None
--- board/ronetix/imx8mq-cm/imx8mq_cm.c | 1 + 1 file changed, 1 insertion(+)
board/ronetix/imx8mq-cm/imx8mq_cm.c +1 -0
@@ -3,6 +3,7 @@* Copyright 2018 NXP */ +#include <env.h> #include <miiphy.h> #include <asm-generic/gpio.h> #include <asm/arch/imx8mq_pins.h>
Signature · 1 line
2.43.0
PATCH v3 9/22 toradex: Include env.h to permit reading the environment
In reply to Tom RiniFrom: Simon Glass <[email protected]>
Two files read from the environment but don't not include the correct header. Update them.
---
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(-)
board/toradex/colibri_imx7/colibri_imx7.c +1 -0
@@ -4,6 +4,7 @@*/ #include <cpu_func.h> +#include <env.h> #include <init.h> #include <net.h> #include <asm/arch/clock.h>
board/toradex/verdin-imx8mm/verdin-imx8mm.c +1 -1
@@ -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>
Signature · 1 line
2.43.0
PATCH v3 10/22 advantech: Include env.h in imx8qm_dmsse20_a1
In reply to Tom RiniFrom: Simon Glass <[email protected]>
This file uses the environment but does not include the header file. Update it.
---
Changes in v3:
- None
--- board/advantech/imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c | 1 + 1 file changed, 1 insertion(+)
board/advantech/imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c +1 -0
@@ -4,6 +4,7 @@* Copyright 2019-2023 Kococonnector GmbH */ +#include <env.h> #include <errno.h> #include <linux/libfdt.h> #include <asm/io.h>
Signature · 1 line
2.43.0
PATCH v3 11/22 tegra: Include env.h to permit reading the environment
In reply to Tom RiniFrom: Simon Glass <[email protected]>
This file reads from the environment but does not include the correct header. Update it.
---
Changes in v3:
- None
--- arch/arm/mach-tegra/dt-setup.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-tegra/dt-setup.c +1 -0
@@ -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>
Signature · 1 line
2.43.0
PATCH v3 12/22 synology: Include env.h to permit reading the environment
In reply to Tom RiniFrom: Simon Glass <[email protected]>
This file reads from the environment but does not include the correct header. Update it.
---
Changes in v3:
- None
--- board/Synology/ds414/ds414.c | 1 + 1 file changed, 1 insertion(+)
board/Synology/ds414/ds414.c +1 -0
@@ -4,6 +4,7 @@* Copyright (C) 2015 Phil Sutter <[email protected]> */ +#include <env.h> #include <init.h> #include <miiphy.h> #include <asm/global_data.h>
Signature · 1 line
2.43.0
PATCH v3 13/22 amlogic: Include env.h to permit reading the environment
In reply to Tom RiniFrom: Simon Glass <[email protected]>
This file reads from the environment but does not include the correct header. Update it.
---
Changes in v3:
- None
--- board/amlogic/jethub-j100/jethub-j100.c | 1 + 1 file changed, 1 insertion(+)
board/amlogic/jethub-j100/jethub-j100.c +1 -0
@@ -5,6 +5,7 @@*/ #include <dm.h> +#include <env.h> #include <init.h> #include <net.h> #include <asm/io.h>
Signature · 1 line
2.43.0
PATCH v3 14/22 freescale: Include env.h to permit reading the environment
In reply to Tom RiniFrom: Simon Glass <[email protected]>
This file reads from the environment but does not include the correct header. Update it.
---
Changes in v3:
- None
--- board/freescale/mx7dsabresd/mx7dsabresd.c | 1 + 1 file changed, 1 insertion(+)
board/freescale/mx7dsabresd/mx7dsabresd.c +1 -0
@@ -3,6 +3,7 @@* Copyright (C) 2015 Freescale Semiconductor, Inc. */ +#include <env.h> #include <init.h> #include <net.h> #include <asm/arch/clock.h>
Signature · 1 line
2.43.0
PATCH v3 15/22 google: Include env.h to permit reading the environment
In reply to Tom RiniFrom: Simon Glass <[email protected]>
This file reads from the environment but does not include the correct header. Update it.
---
Changes in v3:
- None
--- board/google/chameleonv3/board.c | 2 ++ 1 file changed, 2 insertions(+)
board/google/chameleonv3/board.c +2 -0
@@ -2,6 +2,8 @@/* * Copyright 2022 Google LLC */ + +#include <env.h> #include <net.h> #include <errno.h> #include "mercury_aa1.h"
Signature · 1 line
2.43.0
PATCH v3 16/22 liebherr: Include env.h to permit reading the environment
In reply to Tom RiniFrom: Simon Glass <[email protected]>
This file reads from the environment but does not include the correct header. Update it.
---
Changes in v3:
- None
--- board/liebherr/xea/xea.c | 1 + 1 file changed, 1 insertion(+)
board/liebherr/xea/xea.c +1 -0
@@ -13,6 +13,7 @@* */ +#include <env.h> #include <fdt_support.h> #include <init.h> #include <log.h>
Signature · 1 line
2.43.0
Re: [PATCH v3 16/22] liebherr: Include env.h to permit reading the environment
Quoted 19 lines · On Thu, 15 May 2025 17:31:45 -0600 Tom Rini <[email protected]> wrote:
From: Simon Glass <[email protected]>
This file reads from the environment but does not include the correct header. Update it.
Signed-off-by Simon Glass <[email protected]>Reviewed-by Lukasz Majewski <[email protected]>---
Changes in v3:
- None--- board/liebherr/xea/xea.c | 1 + 1 file changed, 1 insertion(+)board/liebherr/xea/xea.c +0
-0
board/liebherr/xea/xea.c line 19
Quoted 7 lines
board/liebherr/xea/xea.c +1
-0@@ -13,6 +13,7 @@* */ +#include <env.h> #include <fdt_support.h> #include <init.h> #include <log.h>
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: [email protected]
PATCH v3 17/22 technexion: Include env.h to permit reading the environment
In reply to Tom RiniFrom: Simon Glass <[email protected]>
This file reads from the environment but does not include the correct header. Update it.
---
Changes in v3:
- None
--- board/technexion/pico-imx7d/pico-imx7d.c | 1 + 1 file changed, 1 insertion(+)
board/technexion/pico-imx7d/pico-imx7d.c +1 -0
@@ -3,6 +3,7 @@* Copyright (C) 2017 NXP Semiconductors */ +#include <env.h> #include <init.h> #include <net.h> #include <asm/arch/clock.h>
Signature · 1 line
2.43.0
PATCH v3 18/22 net: Include byteorder in net6.h
In reply to Tom RiniFrom: Simon Glass <[email protected]>
This file uses byteorder but does not include the header file. Update it.
---
Changes in v3:
- None
--- include/net6.h | 1 + 1 file changed, 1 insertion(+)
include/net6.h +1 -0
@@ -11,6 +11,7 @@#define __NET6_H__#include <net.h> +#include <asm/byteorder.h> #include <linux/ctype.h> #include <linux/errno.h>
Signature · 1 line
2.43.0
PATCH v3 19/22 net: Include env.h in pcap.c
In reply to Tom RiniFrom: Simon Glass <[email protected]>
This file uses the environment but does not include the header file. Update it.
---
Changes in v3:
- None
--- net/pcap.c | 1 + 1 file changed, 1 insertion(+)
net/pcap.c +1 -0
@@ -3,6 +3,7 @@* Copyright 2019 Ramon Fried <[email protected]> */ +#include <env.h> #include <net.h> #include <net/pcap.h> #include <time.h>
Signature · 1 line
2.43.0
PATCH v3 20/22 net: dc2114x: Include env.h to permit reading the environment
In reply to Tom RiniFrom: Simon Glass <[email protected]>
This file uses the environment but does not include the header file. Update it.
---
Changes in v3:
- None
--- drivers/net/dc2114x.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/dc2114x.c +1 -0
@@ -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>
Signature · 1 line
2.43.0
PATCH v3 21/22 global: Avoid indirect inclusion of <env.h> from <net.h>
In reply to Tom RiniNow 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.
---
Changes in v3:
- New patch
--- 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(+)
board/BuR/brppt2/board.c +1 -0
@@ -7,6 +7,7 @@* */ #include <cpu_func.h> +#include <env.h> #include <hang.h> #include <init.h> #include <spl.h>
board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c +1 -0
@@ -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>
board/andestech/ae350/ae350.c +1 -0
@@ -6,6 +6,7 @@#include <config.h> #include <cpu_func.h> +#include <env.h> #include <flash.h> #include <image.h> #include <init.h>
board/data_modul/common/common.c +1 -0
@@ -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>
board/gateworks/gw_ventana/gw_ventana.c +1 -0
@@ -6,6 +6,7 @@*/ #include <command.h> +#include <env.h> #include <fdt_support.h> #include <gsc.h> #include <hwconfig.h>
board/ge/b1x5v2/b1x5v2.c +1 -0
@@ -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>
board/keymile/kmcent2/kmcent2.c +1 -0
@@ -6,6 +6,7 @@* Copyright 2013 Freescale Semiconductor, Inc. */ +#include <env.h> #include <event.h> #include <asm/cache.h> #include <asm/fsl_fdt.h>
board/purism/librem5/librem5.c +1 -0
@@ -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>
board/siemens/iot2050/board.c +1 -0
@@ -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>
board/ti/j721e/evm.c +1 -0
@@ -8,6 +8,7 @@*/ #include <efi_loader.h> +#include <env.h> #include <generic-phy.h> #include <image.h> #include <net.h>
boot/bootmeth_efi.c +1 -0
@@ -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>
boot/bootmeth_pxe.c +1 -0
@@ -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>
cmd/pxe.c +1 -0
@@ -5,6 +5,7 @@*/ #include <command.h> +#include <env.h> #include <fs.h> #include <net.h> #include <net6.h>
drivers/net/pfe_eth/pfe_firmware.c +1 -0
@@ -12,6 +12,7 @@#include <dm.h> #include <dm/device-internal.h> +#include <env.h> #include <image.h> #include <log.h> #include <malloc.h>
lib/efi_loader/efi_bootmgr.c +1 -0
@@ -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>
lib/efi_loader/efi_net.c +1 -0
@@ -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>
net/lwip/dhcp.c +1 -0
@@ -3,6 +3,7 @@#include <command.h> #include <console.h> +#include <env.h> #include <log.h> #include <dm/device.h> #include <linux/delay.h>
net/lwip/dns.c +1 -0
@@ -3,6 +3,7 @@#include <command.h> #include <console.h> +#include <env.h> #include <lwip/dns.h> #include <lwip/timeouts.h> #include <net.h>
net/lwip/net-lwip.c +1 -0
@@ -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>
net/lwip/tftp.c +1 -0
@@ -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>
net/lwip/wget.c +1 -0
@@ -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"
test/dm/dsa.c +1 -0
@@ -3,6 +3,7 @@* Copyright 2020-2021 NXP */ +#include <env.h> #include <net/dsa.h> #include <dm/test.h> #include <test/ut.h>
Signature · 1 line
2.43.0
Re: [PATCH v3 21/22] global: Avoid indirect inclusion of <env.h> from <net.h>
Quoted 45 lines · Tom Rini
Now that
env_get_ip()has been removed, the include file <net.h> does not need anything from <env.h>. Furthermore,include/env.hitself 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 <[email protected]>---
Changes in v3:
- New patchCc "Huan 'Kitty' Wang" <[email protected]>Cc "Ying-Chun Liu (PaulLiu)" <[email protected]>Cc Angus Ainslie <[email protected]> (supporter:PURISM LIBREM5 PHONE)Cc Heinrich Schuchardt <[email protected]>Cc Ian Ray <[email protected]>Cc Ilias Apalodimas <[email protected]>Cc Jan Kiszka <[email protected]>Cc Jerome Forissier <[email protected]>Cc Joe Hershberger <[email protected]>Cc Le Jin <[email protected]>Cc Martyn Welch <[email protected]>Cc Niel Fourie <[email protected]>Cc Ramon Fried <[email protected]>Cc Rick Chen <[email protected]>Cc Simon Glass <[email protected]>Cc Tim Harvey <[email protected]>Cc Wolfgang Wallner <[email protected]>--- 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 +
Quoted 8 lines
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(+)
Re: [PATCH v3 21/22] global: Avoid indirect inclusion of <env.h> from <net.h>
In reply to Tom RiniQuoted 29 lines · Tom Rini
Now that
env_get_ip()has been removed, the include file <net.h> does not need anything from <env.h>. Furthermore,include/env.hitself 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 <[email protected]>---
Changes in v3:
- New patchCc "Huan 'Kitty' Wang" <[email protected]>Cc "Ying-Chun Liu (PaulLiu)" <[email protected]>Cc Angus Ainslie <[email protected]> (supporter:PURISM LIBREM5 PHONE)Cc Heinrich Schuchardt <[email protected]>Cc Ian Ray <[email protected]>Cc Ilias Apalodimas <[email protected]>Cc Jan Kiszka <[email protected]>Cc Jerome Forissier <[email protected]>Cc Joe Hershberger <[email protected]>Cc Le Jin <[email protected]>Cc Martyn Welch <[email protected]>Cc Niel Fourie <[email protected]>Cc Ramon Fried <[email protected]>Cc Rick Chen <[email protected]>Cc Simon Glass <[email protected]>Cc Tim Harvey <[email protected]>Cc Wolfgang Wallner <[email protected]>
Quoted 7 lines
--- 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:
Quoted 282 lines
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(+)board/BuR/brppt2/board.c +1
-0@@ -7,6 +7,7 @@* */ #include <cpu_func.h> +#include <env.h> #include <hang.h> #include <init.h> #include <spl.h> board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c +1
-0@@ -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> board/andestech/ae350/ae350.c +1
-0@@ -6,6 +6,7 @@#include <config.h> #include <cpu_func.h> +#include <env.h> #include <flash.h> #include <image.h> #include <init.h> board/data_modul/common/common.c +1
-0@@ -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> board/gateworks/gw_ventana/gw_ventana.c +1
-0@@ -6,6 +6,7 @@*/ #include <command.h> +#include <env.h> #include <fdt_support.h> #include <gsc.h> #include <hwconfig.h> board/ge/b1x5v2/b1x5v2.c +1
-0@@ -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> board/keymile/kmcent2/kmcent2.c +1
-0@@ -6,6 +6,7 @@* Copyright 2013 Freescale Semiconductor, Inc. */ +#include <env.h> #include <event.h> #include <asm/cache.h> #include <asm/fsl_fdt.h> board/purism/librem5/librem5.c +1
-0@@ -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> board/siemens/iot2050/board.c +1
-0@@ -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> board/ti/j721e/evm.c +1
-0@@ -8,6 +8,7 @@*/ #include <efi_loader.h> +#include <env.h> #include <generic-phy.h> #include <image.h> #include <net.h> boot/bootmeth_efi.c +1
-0@@ -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> boot/bootmeth_pxe.c +1
-0@@ -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> cmd/pxe.c +1
-0@@ -5,6 +5,7 @@*/ #include <command.h> +#include <env.h> #include <fs.h> #include <net.h> #include <net6.h> drivers/net/pfe_eth/pfe_firmware.c +1
-0@@ -12,6 +12,7 @@#include <dm.h> #include <dm/device-internal.h> +#include <env.h> #include <image.h> #include <log.h> #include <malloc.h> lib/efi_loader/efi_bootmgr.c +1
-0@@ -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> lib/efi_loader/efi_net.c +1
-0@@ -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> net/lwip/dhcp.c +1
-0@@ -3,6 +3,7 @@#include <command.h> #include <console.h> +#include <env.h> #include <log.h> #include <dm/device.h> #include <linux/delay.h> net/lwip/dns.c +1
-0@@ -3,6 +3,7 @@#include <command.h> #include <console.h> +#include <env.h> #include <lwip/dns.h> #include <lwip/timeouts.h> #include <net.h> net/lwip/net-lwip.c +1
-0@@ -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> net/lwip/tftp.c +1
-0@@ -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> net/lwip/wget.c +1
-0@@ -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" test/dm/dsa.c +1
-0@@ -3,6 +3,7 @@* Copyright 2020-2021 NXP */ +#include <env.h> #include <net/dsa.h> #include <dm/test.h> #include <test/ut.h>
Re: [PATCH v3 21/22] global: Avoid indirect inclusion of <env.h> from <net.h>
In reply to Tom RiniQuoted 33 lines
From: Tom Rini <[email protected]>
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.hitself 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 <[email protected]>---
Changes in v3:
- New patchCc "Huan 'Kitty' Wang" <[email protected]>Cc "Ying-Chun Liu (PaulLiu)" <[email protected]>Cc Angus Ainslie <[email protected]> (supporter:PURISM LIBREM5 PHONE)Cc Heinrich Schuchardt <[email protected]>Cc Ian Ray <[email protected]>Cc Ilias Apalodimas <[email protected]>Cc Jan Kiszka <[email protected]>Cc Jerome Forissier <[email protected]>Cc Joe Hershberger <[email protected]>Cc Le Jin <[email protected]>Cc Martyn Welch <[email protected]>Cc Niel Fourie <[email protected]>Cc Ramon Fried <[email protected]>Cc Rick Chen <[email protected]>Cc Simon Glass <[email protected]>Cc Tim Harvey <[email protected]>Cc Wolfgang Wallner <[email protected]>
Quoted 2 lines
---
board/BuR/brppt2/board.c | 1 +
For brppt2/board.c:
Quoted 35 lines
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(+)board/BuR/brppt2/board.c +1
-0@@ -7,6 +7,7 @@* */ #include <cpu_func.h> +#include <env.h> #include <hang.h> #include <init.h> #include <spl.h>
Re: [PATCH v3 21/22] global: Avoid indirect inclusion of <env.h> from <net.h>
In reply to Tom RiniQuoted 8 lines · Tom Rini
Now that
env_get_ip()has been removed, the include file <net.h> does not need anything from <env.h>. Furthermore,include/env.hitself 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.
Quoted 314 lines
Signed-off-by Tom Rini <[email protected]>---
Changes in v3:
- New patchCc "Huan 'Kitty' Wang" <[email protected]>Cc "Ying-Chun Liu (PaulLiu)" <[email protected]>Cc Angus Ainslie <[email protected]> (supporter:PURISM LIBREM5 PHONE)Cc Heinrich Schuchardt <[email protected]>Cc Ian Ray <[email protected]>Cc Ilias Apalodimas <[email protected]>Cc Jan Kiszka <[email protected]>Cc Jerome Forissier <[email protected]>Cc Joe Hershberger <[email protected]>Cc Le Jin <[email protected]>Cc Martyn Welch <[email protected]>Cc Niel Fourie <[email protected]>Cc Ramon Fried <[email protected]>Cc Rick Chen <[email protected]>Cc Simon Glass <[email protected]>Cc Tim Harvey <[email protected]>Cc Wolfgang Wallner <[email protected]>--- 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(+)board/BuR/brppt2/board.c +1
-0@@ -7,6 +7,7 @@* */ #include <cpu_func.h> +#include <env.h> #include <hang.h> #include <init.h> #include <spl.h> board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c +1
-0@@ -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> board/andestech/ae350/ae350.c +1
-0@@ -6,6 +6,7 @@#include <config.h> #include <cpu_func.h> +#include <env.h> #include <flash.h> #include <image.h> #include <init.h> board/data_modul/common/common.c +1
-0@@ -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> board/gateworks/gw_ventana/gw_ventana.c +1
-0@@ -6,6 +6,7 @@*/ #include <command.h> +#include <env.h> #include <fdt_support.h> #include <gsc.h> #include <hwconfig.h> board/ge/b1x5v2/b1x5v2.c +1
-0@@ -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> board/keymile/kmcent2/kmcent2.c +1
-0@@ -6,6 +6,7 @@* Copyright 2013 Freescale Semiconductor, Inc. */ +#include <env.h> #include <event.h> #include <asm/cache.h> #include <asm/fsl_fdt.h> board/purism/librem5/librem5.c +1
-0@@ -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> board/siemens/iot2050/board.c +1
-0@@ -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> board/ti/j721e/evm.c +1
-0@@ -8,6 +8,7 @@*/ #include <efi_loader.h> +#include <env.h> #include <generic-phy.h> #include <image.h> #include <net.h> boot/bootmeth_efi.c +1
-0@@ -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> boot/bootmeth_pxe.c +1
-0@@ -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> cmd/pxe.c +1
-0@@ -5,6 +5,7 @@*/ #include <command.h> +#include <env.h> #include <fs.h> #include <net.h> #include <net6.h> drivers/net/pfe_eth/pfe_firmware.c +1
-0@@ -12,6 +12,7 @@#include <dm.h> #include <dm/device-internal.h> +#include <env.h> #include <image.h> #include <log.h> #include <malloc.h> lib/efi_loader/efi_bootmgr.c +1
-0@@ -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> lib/efi_loader/efi_net.c +1
-0@@ -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> net/lwip/dhcp.c +1
-0@@ -3,6 +3,7 @@#include <command.h> #include <console.h> +#include <env.h> #include <log.h> #include <dm/device.h> #include <linux/delay.h> net/lwip/dns.c +1
-0@@ -3,6 +3,7 @@#include <command.h> #include <console.h> +#include <env.h> #include <lwip/dns.h> #include <lwip/timeouts.h> #include <net.h> net/lwip/net-lwip.c +1
-0@@ -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> net/lwip/tftp.c +1
-0@@ -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> net/lwip/wget.c +1
-0@@ -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" test/dm/dsa.c +1
-1@@ -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
PATCH v3 22/22 include/net.h: Drop <env.h>
In reply to Tom RiniNow 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.
---
Changes in v3:
- New patch
--- include/net-common.h | 1 - 1 file changed, 1 deletion(-)
include/net-common.h +0 -1
@@ -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>
Signature · 1 line
2.43.0
Re: [PATCH v3 00/22] Remove <env.h> from <net.h>
In reply to Tom RiniQuoted 19 lines · Tom Rini
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
- Removingenv_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 calledenv_getrepeatedly). 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 buildlib/net_utils.cwherestring_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.
Quoted 1 line
[...]
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: fe33175c073fe21945b39a4a8c27806cf0154bf3Signature · 1 line
Tom
Quoted 11 lines · Tom Rini
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 aboutnet-common.handenv_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: 1e50f7457fcaaba2caf642132cf4f00f1eba29a9Signature · 1 line
Tom