"Das U-Boot" Source Tree
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

global_data: Remove environment members if not used

If the environment is not enabled we don't need these fields in
global_data. Make them conditional.

Make these fields conditional. Move env_buf up one so it can share
an #ifdef.

Signed-off-by: Simon Glass <sjg@chromium.org>

authored by

Simon Glass and committed by
Tom Rini
66ca5b78 d9902107

+17 -5
+7 -1
common/hwconfig.c
··· 77 77 78 78 /* if we are passed a buffer use it, otherwise try the environment */ 79 79 if (!env_hwconfig) { 80 - if (!(gd->flags & GD_FLG_ENV_READY) && gd->env_valid != ENV_VALID) { 80 + #if CONFIG_IS_ENABLED(ENV_SUPPORT) 81 + if (!(gd->flags & GD_FLG_ENV_READY) && 82 + gd->env_valid != ENV_VALID) 83 + #else 84 + if (true) 85 + #endif 86 + { 81 87 printf("WARNING: Calling __hwconfig without a buffer " 82 88 "and before environment is ready\n"); 83 89 return NULL;
+8 -4
include/asm-generic/global_data.h
··· 86 86 * @cpu_clk: CPU clock rate in Hz 87 87 */ 88 88 unsigned long cpu_clk; 89 + #if CONFIG_IS_ENABLED(ENV_SUPPORT) 89 90 /** 90 91 * @env_addr: address of environment structure 91 92 * ··· 93 94 * environment variables. 94 95 */ 95 96 unsigned long env_addr; 97 + #endif /* ENV_SUPPORT */ 96 98 /** 97 99 * @ram_base: base address of RAM used by U-Boot 98 100 */ ··· 134 136 * @baudrate: baud rate of the serial interface 135 137 */ 136 138 unsigned int baudrate; 139 + #if CONFIG_IS_ENABLED(ENV_SUPPORT) 137 140 /** 138 141 * @env_has_init: bit mask indicating environment locations 139 142 * ··· 151 154 */ 152 155 char env_load_prio; 153 156 /** 157 + * @env_buf: buffer for env_get() before reloc 158 + */ 159 + char env_buf[32]; 160 + #endif /* ENV_SUPPORT */ 161 + /** 154 162 * @fdt_src: Source of FDT 155 163 */ 156 164 enum fdt_source_t fdt_src; 157 - /** 158 - * @env_buf: buffer for env_get() before reloc 159 - */ 160 - char env_buf[32]; 161 165 /** 162 166 * @arch: architecture-specific data 163 167 */
+2
lib/asm-offsets.c
··· 44 44 45 45 DEFINE(GD_NEW_GD, offsetof(struct global_data, new_gd)); 46 46 47 + #if CONFIG_IS_ENABLED(ENV_SUPPORT) 47 48 DEFINE(GD_ENV_ADDR, offsetof(struct global_data, env_addr)); 49 + #endif 48 50 49 51 return 0; 50 52 }