]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
global_data: Use less space for environment fields
authorSimon Glass <sjg@chromium.org>
Wed, 21 Aug 2024 16:19:08 +0000 (10:19 -0600)
committerTom Rini <trini@konsulko.com>
Mon, 26 Aug 2024 20:05:38 +0000 (14:05 -0600)
Use shorter types for some of these fields to save space. Reorder to put
fields with like alignment together.

Signed-off-by: Simon Glass <sjg@chromium.org>
include/asm-generic/global_data.h
include/env_internal.h

index 86e8d654a28803ed686578d3fbc2fd3dd62c5aa0..1252b8acefac3b52a06357668709d6d41ee53603 100644 (file)
@@ -114,21 +114,21 @@ struct global_data {
         */
        unsigned long env_addr;
        /**
-        * @env_valid: environment is valid
+        * @env_has_init: bit mask indicating environment locations
         *
-        * See &enum env_valid
+        * &enum env_location defines which bit relates to which location
         */
-       unsigned long env_valid;
+       unsigned short env_has_init;
        /**
-        * @env_has_init: bit mask indicating environment locations
+        * @env_valid: environment is valid
         *
-        * &enum env_location defines which bit relates to which location
+        * See &enum env_valid
         */
-       unsigned long env_has_init;
+       unsigned char env_valid;
        /**
         * @env_load_prio: priority of the loaded environment
         */
-       int env_load_prio;
+       char env_load_prio;
        /**
         * @ram_base: base address of RAM used by U-Boot
         */
index 0a267e355923f07172d644d30f018ae5d39a07c8..c1c0727e4d0bef6efdf75f2d583dcd1888d010ec 100644 (file)
@@ -100,6 +100,7 @@ extern const char default_environment[];
 #include <env_flags.h>
 #include <search.h>
 
+/* this is stored as bits in gd->env_has_init so is limited to 16 entries */
 enum env_location {
        ENVL_UNKNOWN,
        ENVL_EEPROM,