summaryrefslogtreecommitdiff
path: root/tools/env/fw_env.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/env/fw_env.c')
-rw-r--r--tools/env/fw_env.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index b6036c8ae2a..46747d337c5 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -80,7 +80,7 @@ static int dev_current;
#define ENVSECTORS(i) envdevices[(i)].env_sectors
#define DEVTYPE(i) envdevices[(i)].mtd_type
-#define CFG_ENV_SIZE ENVSIZE(dev_current)
+#define CONFIG_ENV_SIZE ENVSIZE(dev_current)
#define ENV_SIZE getenvsize()
@@ -212,7 +212,7 @@ static int get_config (char *);
#endif
static inline ulong getenvsize (void)
{
- ulong rc = CFG_ENV_SIZE - sizeof (long);
+ ulong rc = CONFIG_ENV_SIZE - sizeof (long);
if (HaveRedundEnv)
rc -= sizeof (char);
@@ -401,7 +401,7 @@ int fw_setenv (int argc, char *argv[])
++env;
/*
* Overflow when:
- * "name" + "=" + "val" +"\0\0" > CFG_ENV_SIZE - (env-environment)
+ * "name" + "=" + "val" +"\0\0" > CONFIG_ENV_SIZE - (env-environment)
*/
len = strlen (name) + 2;
/* add '=' for first arg, ' ' for all others */
@@ -753,7 +753,7 @@ static int flash_write (int fd_current, int fd_target, int dev_target)
DEVOFFSET (dev_target), DEVNAME (dev_target));
#endif
rc = flash_write_buf (dev_target, fd_target, environment.image,
- CFG_ENV_SIZE, DEVOFFSET (dev_target),
+ CONFIG_ENV_SIZE, DEVOFFSET (dev_target),
DEVTYPE(dev_target));
if (rc < 0)
return rc;
@@ -790,10 +790,10 @@ static int flash_read (int fd)
DEVTYPE(dev_current) = mtdinfo.type;
- rc = flash_read_buf (dev_current, fd, environment.image, CFG_ENV_SIZE,
+ rc = flash_read_buf (dev_current, fd, environment.image, CONFIG_ENV_SIZE,
DEVOFFSET (dev_current), mtdinfo.type);
- return (rc != CFG_ENV_SIZE) ? -1 : 0;
+ return (rc != CONFIG_ENV_SIZE) ? -1 : 0;
}
static int flash_io (int mode)
@@ -890,11 +890,11 @@ static int env_init (void)
if (parse_config ()) /* should fill envdevices */
return -1;
- addr0 = calloc (1, CFG_ENV_SIZE);
+ addr0 = calloc (1, CONFIG_ENV_SIZE);
if (addr0 == NULL) {
fprintf (stderr,
"Not enough memory for environment (%ld bytes)\n",
- CFG_ENV_SIZE);
+ CONFIG_ENV_SIZE);
return -1;
}
@@ -929,11 +929,11 @@ static int env_init (void)
flag0 = *environment.flags;
dev_current = 1;
- addr1 = calloc (1, CFG_ENV_SIZE);
+ addr1 = calloc (1, CONFIG_ENV_SIZE);
if (addr1 == NULL) {
fprintf (stderr,
"Not enough memory for environment (%ld bytes)\n",
- CFG_ENV_SIZE);
+ CONFIG_ENV_SIZE);
return -1;
}
redundant = addr1;