Skip to content

Commit 00caae6

Browse files
sjg20trini
authored andcommitted
env: Rename getenv/_f() to env_get()
We are now using an env_ prefix for environment functions. Rename these two functions for consistency. Also add function comments in common.h. Quite a few places use getenv() in a condition context, provoking a warning from checkpatch. These are fixed up in this patch also. Suggested-by: Wolfgang Denk <[email protected]> Signed-off-by: Simon Glass <[email protected]>
1 parent fd1e959 commit 00caae6

File tree

213 files changed

+531
-502
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

213 files changed

+531
-502
lines changed

README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3286,7 +3286,7 @@ but it can not erase, write this NOR flash by SRIO or PCIE interface.
32863286

32873287
Please note that the environment is read-only until the monitor
32883288
has been relocated to RAM and a RAM copy of the environment has been
3289-
created; also, when using EEPROM you will have to use getenv_f()
3289+
created; also, when using EEPROM you will have to use env_get_f()
32903290
until then to read environment variables.
32913291

32923292
The environment is protected by a CRC32 checksum. Before the monitor

api/api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ static int API_env_get(va_list ap)
458458
if ((value = (char **)va_arg(ap, uintptr_t)) == NULL)
459459
return API_EINVAL;
460460

461-
*value = getenv(name);
461+
*value = env_get(name);
462462

463463
return 0;
464464
}

arch/arc/lib/bootm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static void boot_jump_linux(bootm_headers_t *images, int flag)
8585
r2 = (unsigned int)images->ft_addr;
8686
} else {
8787
r0 = 1;
88-
r2 = (unsigned int)getenv("bootargs");
88+
r2 = (unsigned int)env_get("bootargs");
8989
}
9090

9191
smp_set_core_boot_addr((unsigned long)kernel_entry, -1);

arch/arm/cpu/armv8/fsl-layerscape/soc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static void erratum_a008514(void)
9595

9696
static unsigned long get_internval_val_mhz(void)
9797
{
98-
char *interval = getenv(PLATFORM_CYCLE_ENV_VAR);
98+
char *interval = env_get(PLATFORM_CYCLE_ENV_VAR);
9999
/*
100100
* interval is the number of platform cycles(MHz) between
101101
* wake up events generated by EPU.

arch/arm/lib/bootm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ static void do_nonsec_virt_switch(void)
216216
/* Subcommand: PREP */
217217
static void boot_prep_linux(bootm_headers_t *images)
218218
{
219-
char *commandline = getenv("bootargs");
219+
char *commandline = env_get("bootargs");
220220

221221
if (IMAGE_ENABLE_OF_LIBFDT && images->ft_len) {
222222
#ifdef CONFIG_OF_LIBFDT
@@ -273,7 +273,7 @@ __weak bool armv7_boot_nonsec_default(void)
273273
#ifdef CONFIG_ARMV7_NONSEC
274274
bool armv7_boot_nonsec(void)
275275
{
276-
char *s = getenv("bootm_boot_mode");
276+
char *s = env_get("bootm_boot_mode");
277277
bool nonsec = armv7_boot_nonsec_default();
278278

279279
if (s && !strcmp(s, "sec"))
@@ -361,7 +361,7 @@ static void boot_jump_linux(bootm_headers_t *images, int flag)
361361
ulong addr = (ulong)kernel_entry | 1;
362362
kernel_entry = (void *)addr;
363363
#endif
364-
s = getenv("machid");
364+
s = env_get("machid");
365365
if (s) {
366366
if (strict_strtoul(s, 16, &machid) < 0) {
367367
debug("strict_strtoul failed!\n");

arch/arm/mach-imx/video.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ int board_video_skip(void)
1010
{
1111
int i;
1212
int ret;
13-
char const *panel = getenv("panel");
13+
char const *panel = env_get("panel");
1414

1515
if (!panel) {
1616
for (i = 0; i < display_count; i++) {

arch/arm/mach-keystone/ddr3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ void ddr3_check_ecc_int(u32 base)
331331
int ecc_test = 0;
332332
u32 value = __raw_readl(base + KS2_DDR3_ECC_INT_STATUS_OFFSET);
333333

334-
env = getenv("ecc_test");
334+
env = env_get("ecc_test");
335335
if (env)
336336
ecc_test = simple_strtol(env, NULL, 0);
337337

arch/arm/mach-keystone/keystone.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ int misc_init_r(void)
4646
char *env;
4747
long ks2_debug = 0;
4848

49-
env = getenv("ks2_debug");
49+
env = env_get("ks2_debug");
5050

5151
if (env)
5252
ks2_debug = simple_strtol(env, NULL, 0);

arch/arm/mach-kirkwood/cpu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ int kw_config_adr_windows(void)
129129
static void kw_sysrst_action(void)
130130
{
131131
int ret;
132-
char *s = getenv("sysrstcmd");
132+
char *s = env_get("sysrstcmd");
133133

134134
if (!s) {
135135
debug("Error.. %s failed, check sysrstcmd\n",
@@ -153,7 +153,7 @@ static void kw_sysrst_check(void)
153153
/*
154154
* no action if sysrstdelay environment variable is not defined
155155
*/
156-
s = getenv("sysrstdelay");
156+
s = env_get("sysrstdelay");
157157
if (s == NULL)
158158
return;
159159

arch/arm/mach-omap2/utils.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static void omap_set_fastboot_board_rev(void)
7070
{
7171
const char *board_rev;
7272

73-
board_rev = getenv("board_rev");
73+
board_rev = env_get("board_rev");
7474
if (board_rev == NULL)
7575
printf("Warning: fastboot.board_rev: unknown board revision\n");
7676

@@ -169,7 +169,7 @@ void omap_die_id_serial(void)
169169

170170
omap_die_id((unsigned int *)&die_id);
171171

172-
if (!getenv("serial#")) {
172+
if (!env_get("serial#")) {
173173
snprintf(serial_string, sizeof(serial_string),
174174
"%08x%08x", die_id[0], die_id[3]);
175175

@@ -182,7 +182,7 @@ void omap_die_id_get_board_serial(struct tag_serialnr *serialnr)
182182
char *serial_string;
183183
unsigned long long serial;
184184

185-
serial_string = getenv("serial#");
185+
serial_string = env_get("serial#");
186186

187187
if (serial_string) {
188188
serial = simple_strtoull(serial_string, NULL, 16);
@@ -202,7 +202,7 @@ void omap_die_id_usbethaddr(void)
202202

203203
omap_die_id((unsigned int *)&die_id);
204204

205-
if (!getenv("usbethaddr")) {
205+
if (!env_get("usbethaddr")) {
206206
/*
207207
* Create a fake MAC address from the processor ID code.
208208
* First byte is 0x02 to signify locally administered.

0 commit comments

Comments
 (0)