Skip to content
Snippets Groups Projects
Commit f2abca84 authored by Simon Glass's avatar Simon Glass Committed by Tom Rini
Browse files

main: Use get/setenv_ulong()


These functions are now available, so use them to avoid extra code here.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarJoe Hershberger <joe.hershberger@ni.com>
parent bc2b4c27
No related branches found
No related tags found
No related merge requests found
...@@ -352,18 +352,14 @@ static void process_boot_delay(void) ...@@ -352,18 +352,14 @@ static void process_boot_delay(void)
#ifdef CONFIG_BOOTCOUNT_LIMIT #ifdef CONFIG_BOOTCOUNT_LIMIT
unsigned long bootcount = 0; unsigned long bootcount = 0;
unsigned long bootlimit = 0; unsigned long bootlimit = 0;
char *bcs;
char bcs_set[16];
#endif /* CONFIG_BOOTCOUNT_LIMIT */ #endif /* CONFIG_BOOTCOUNT_LIMIT */
#ifdef CONFIG_BOOTCOUNT_LIMIT #ifdef CONFIG_BOOTCOUNT_LIMIT
bootcount = bootcount_load(); bootcount = bootcount_load();
bootcount++; bootcount++;
bootcount_store (bootcount); bootcount_store (bootcount);
sprintf (bcs_set, "%lu", bootcount); setenv_ulong("bootcount", bootcount);
setenv ("bootcount", bcs_set); bootlimit = getenv_ulong("bootlimit", 10, 0);
bcs = getenv ("bootlimit");
bootlimit = bcs ? simple_strtoul (bcs, NULL, 10) : 0;
#endif /* CONFIG_BOOTCOUNT_LIMIT */ #endif /* CONFIG_BOOTCOUNT_LIMIT */
s = getenv ("bootdelay"); s = getenv ("bootdelay");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment