env: Move env_set_hex() to env.h
authorSimon Glass <sjg@chromium.org>
Thu, 1 Aug 2019 15:46:46 +0000 (09:46 -0600)
committerTom Rini <trini@konsulko.com>
Sun, 11 Aug 2019 20:43:41 +0000 (16:43 -0400)
Move env_set_hex() over to the new header file along with env_set_addr()
which uses it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
39 files changed:
api/api.c
arch/arm/mach-tegra/cboot.c
arch/arm/mach-uniphier/board_late_init.c
board/BuR/common/common.c
board/boundary/nitrogen6x/nitrogen6x.c
board/broadcom/bcmstb/bcmstb.c
board/emulation/qemu-riscv/qemu-riscv.c
board/freescale/qemu-ppce500/qemu-ppce500.c
board/raspberrypi/rpi/rpi.c
board/sunxi/board.c
board/xilinx/zynqmp/cmds.c
cmd/cbfs.c
cmd/cramfs.c
cmd/fdt.c
cmd/jffs2.c
cmd/load.c
cmd/lzmadec.c
cmd/nand.c
cmd/reiser.c
cmd/setexpr.c
cmd/spl.c
cmd/tpm-v1.c
cmd/trace.c
cmd/ubi.c
cmd/unzip.c
cmd/ximg.c
cmd/zfs.c
cmd/zip.c
common/autoboot.c
common/bootm.c
common/bootm_os.c
drivers/fastboot/fb_command.c
drivers/net/fm/fm.c
drivers/usb/gadget/f_sdp.c
fs/fs.c
fs/ubifs/ubifs.c
include/common.h
include/env.h
net/net.c

index 9f03f1a..8a41b7c 100644 (file)
--- a/api/api.c
+++ b/api/api.c
@@ -8,6 +8,7 @@
 #include <config.h>
 #include <command.h>
 #include <common.h>
+#include <env.h>
 #include <malloc.h>
 #include <environment.h>
 #include <linux/types.h>
index a829ef7..bd4f336 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <env.h>
 #include <environment.h>
 #include <fdt_support.h>
 #include <fdtdec.h>
index 3180b24..14b61fc 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <env.h>
 #include <spl.h>
 #include <linux/libfdt.h>
 #include <nand.h>
index 89087d7..148fc90 100644 (file)
@@ -10,6 +10,7 @@
  */
 #include <version.h>
 #include <common.h>
+#include <env.h>
 #include <fdtdec.h>
 #include <i2c.h>
 #include <lcd.h>
index 867eade..26af3f7 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <env.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/imx-regs.h>
index 7f8e0f9..5fc2c05 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <linux/types.h>
 #include <common.h>
+#include <env.h>
 #include <asm/io.h>
 #include <asm/bootm.h>
 #include <mach/timer.h>
index d6167aa..49e304f 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <env.h>
 #include <fdtdec.h>
 #include <virtio_types.h>
 #include <virtio.h>
index 42a6b54..fb36d83 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <env.h>
 #include <pci.h>
 #include <asm/processor.h>
 #include <asm/mmu.h>
index 617c892..104589b 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <config.h>
 #include <dm.h>
+#include <env.h>
 #include <environment.h>
 #include <efi_loader.h>
 #include <fdt_support.h>
index 98bc3cd..bb425cb 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <env.h>
 #include <mmc.h>
 #include <axp_pmic.h>
 #include <generic-phy.h>
index 321670d..ed7ba58 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <env.h>
 #include <malloc.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/sys_proto.h>
index c118a95..3d1fc95 100644 (file)
@@ -8,6 +8,7 @@
  */
 #include <common.h>
 #include <command.h>
+#include <env.h>
 #include <cbfs.h>
 
 static int do_cbfs_init(cmd_tbl_t *cmdtp, int flag, int argc,
index 598028c..2188910 100644 (file)
@@ -12,6 +12,7 @@
  */
 #include <common.h>
 #include <command.h>
+#include <env.h>
 #include <malloc.h>
 #include <mapmem.h>
 #include <linux/list.h>
index 10d8f32..25a6ed4 100644 (file)
--- a/cmd/fdt.c
+++ b/cmd/fdt.c
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <env.h>
 #include <linux/ctype.h>
 #include <linux/types.h>
 #include <asm/global_data.h>
index 64621f2..b47cd3d 100644 (file)
@@ -72,6 +72,7 @@
  */
 #include <common.h>
 #include <command.h>
+#include <env.h>
 #include <malloc.h>
 #include <jffs2/jffs2.h>
 #include <linux/list.h>
index dd1e8da..713fe56 100644 (file)
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <command.h>
 #include <console.h>
+#include <env.h>
 #include <s_record.h>
 #include <net.h>
 #include <exports.h>
index 6860b5f..e3b9cc7 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <env.h>
 #include <mapmem.h>
 #include <asm/io.h>
 
index 899d504..27efef2 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/mtd/mtd.h>
 #include <command.h>
 #include <console.h>
+#include <env.h>
 #include <watchdog.h>
 #include <malloc.h>
 #include <asm/byteorder.h>
index 2c0bca1..7f51b92 100644 (file)
@@ -11,6 +11,7 @@
 #include <common.h>
 #include <config.h>
 #include <command.h>
+#include <env.h>
 #include <image.h>
 #include <linux/ctype.h>
 #include <asm/byteorder.h>
index 1a6cecd..0182f19 100644 (file)
@@ -11,6 +11,7 @@
 #include <common.h>
 #include <config.h>
 #include <command.h>
+#include <env.h>
 #include <mapmem.h>
 
 static ulong get_arg(char *s, int w)
index 038f488..56051b8 100644 (file)
--- a/cmd/spl.c
+++ b/cmd/spl.c
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <command.h>
 #include <cmd_spl.h>
+#include <env.h>
 #include <linux/libfdt.h>
 
 DECLARE_GLOBAL_DATA_PTR;
index b75e093..2807331 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <env.h>
 #include <malloc.h>
 #include <asm/unaligned.h>
 #include <tpm-common.h>
index 7d328f8..392b129 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <env.h>
 #include <mapmem.h>
 #include <trace.h>
 #include <asm/io.h>
index c511a2f..ca5dc90 100644 (file)
--- a/cmd/ubi.c
+++ b/cmd/ubi.c
@@ -13,6 +13,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <env.h>
 #include <exports.h>
 #include <memalign.h>
 #include <mtd.h>
index 8474d9b..afd58e7 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <env.h>
 #include <gzip.h>
 
 static int do_unzip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
index 920a80e..a948100 100644 (file)
@@ -13,6 +13,7 @@
  */
 #include <common.h>
 #include <command.h>
+#include <env.h>
 #include <gzip.h>
 #include <image.h>
 #include <mapmem.h>
index 384ac4c..ed5402b 100644 (file)
--- a/cmd/zfs.c
+++ b/cmd/zfs.c
@@ -12,6 +12,7 @@
 #include <part.h>
 #include <config.h>
 #include <command.h>
+#include <env.h>
 #include <image.h>
 #include <linux/ctype.h>
 #include <asm/byteorder.h>
index 9cd400a..8ef46e9 100644 (file)
--- a/cmd/zip.c
+++ b/cmd/zip.c
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <env.h>
 
 static int do_zip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
index 7a91736..b28bd68 100644 (file)
@@ -9,6 +9,7 @@
 #include <bootretry.h>
 #include <cli.h>
 #include <console.h>
+#include <env.h>
 #include <fdtdec.h>
 #include <hash.h>
 #include <memalign.h>
index 4629cdd..02295da 100644 (file)
@@ -7,6 +7,7 @@
 #ifndef USE_HOSTCC
 #include <common.h>
 #include <bootstage.h>
+#include <env.h>
 #include <errno.h>
 #include <fdt_support.h>
 #include <lmb.h>
index 855c471..6fb7d65 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <bootm.h>
+#include <env.h>
 #include <fdt_support.h>
 #include <linux/libfdt.h>
 #include <malloc.h>
index 200f991..4864344 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <env.h>
 #include <fastboot.h>
 #include <fastboot-internal.h>
 #include <fb_mmc.h>
index 0a43dfe..ce0f167 100644 (file)
@@ -4,6 +4,7 @@
  *     Dave Liu <daveliu@freescale.com>
  */
 #include <common.h>
+#include <env.h>
 #include <malloc.h>
 #include <asm/io.h>
 #include <linux/errno.h>
index fab7ce6..bcd1c5d 100644 (file)
@@ -19,6 +19,7 @@
 #include <errno.h>
 #include <common.h>
 #include <console.h>
+#include <env.h>
 #include <malloc.h>
 
 #include <linux/usb/ch9.h>
diff --git a/fs/fs.c b/fs/fs.c
index 48d8f1f..d8a4ced 100644 (file)
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -6,6 +6,7 @@
 #include <config.h>
 #include <errno.h>
 #include <common.h>
+#include <env.h>
 #include <mapmem.h>
 #include <part.h>
 #include <ext4fs.h>
index 72e8a24..67a0e8c 100644 (file)
@@ -12,6 +12,7 @@
  */
 
 #include <common.h>
+#include <env.h>
 #include <gzip.h>
 #include <memalign.h>
 #include "ubifs.h"
index 26ec18d..100eac6 100644 (file)
@@ -209,27 +209,6 @@ int env_set(const char *varname, const char *value);
  */
 int env_set_ulong(const char *varname, ulong value);
 
-/**
- * env_set_hex() - set an environment variable to a hex value
- *
- * @varname: Variable to adjust
- * @value: Value to set for the variable (will be converted to a hex string)
- * @return 0 if OK, 1 on error
- */
-int env_set_hex(const char *varname, ulong value);
-
-/**
- * env_set_addr - Set an environment variable to an address in hex
- *
- * @varname:   Environment variable to set
- * @addr:      Value to set it to
- * @return 0 if ok, 1 on error
- */
-static inline int env_set_addr(const char *varname, const void *addr)
-{
-       return env_set_hex(varname, (ulong)addr);
-}
-
 void   pci_init_board(void);
 
 /* common/exports.c */
index bf34ac3..5c780f3 100644 (file)
@@ -10,6 +10,7 @@
 #define __ENV_H
 
 #include <stdbool.h>
+#include <linux/types.h>
 
 /**
  * env_get_id() - Gets a sequence number for the environment
@@ -63,6 +64,27 @@ int env_match(unsigned char *name, int index);
 int env_get_f(const char *name, char *buf, unsigned int len);
 
 /**
+ * env_set_hex() - set an environment variable to a hex value
+ *
+ * @varname: Variable to adjust
+ * @value: Value to set for the variable (will be converted to a hex string)
+ * @return 0 if OK, 1 on error
+ */
+int env_set_hex(const char *varname, ulong value);
+
+/**
+ * env_set_addr - Set an environment variable to an address in hex
+ *
+ * @varname:   Environment variable to set
+ * @addr:      Value to set it to
+ * @return 0 if ok, 1 on error
+ */
+static inline int env_set_addr(const char *varname, const void *addr)
+{
+       return env_set_hex(varname, (ulong)addr);
+}
+
+/**
  * env_complete() - return an auto-complete for environment variables
  *
  * @var: partial name to auto-complete
index 58b0417..1a175c4 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -90,6 +90,7 @@
 #include <common.h>
 #include <command.h>
 #include <console.h>
+#include <env.h>
 #include <environment.h>
 #include <errno.h>
 #include <net.h>