constify default env

I can't see any obvious needs for the default environment to be writable,
so make it const.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
Mike Frysinger 2011-04-23 23:43:21 +00:00 committed by Wolfgang Denk
parent c3eb3fe490
commit 147c7169e8
3 changed files with 4 additions and 4 deletions

View file

@ -47,7 +47,7 @@ static uchar env_get_char_init (int index);
#define XMK_STR(x) #x #define XMK_STR(x) #x
#define MK_STR(x) XMK_STR(x) #define MK_STR(x) XMK_STR(x)
uchar default_environment[] = { const uchar default_environment[] = {
#ifdef CONFIG_BOOTARGS #ifdef CONFIG_BOOTARGS
"bootargs=" CONFIG_BOOTARGS "\0" "bootargs=" CONFIG_BOOTARGS "\0"
#endif #endif
@ -162,7 +162,7 @@ uchar env_get_char (int index)
return (c); return (c);
} }
uchar *env_get_addr (int index) const uchar *env_get_addr (int index)
{ {
if (gd->env_valid) if (gd->env_valid)
return (uchar *)(gd->env_addr + index); return (uchar *)(gd->env_addr + index);

View file

@ -74,7 +74,7 @@ static env_t *flash_addr_new = (env_t *)CONFIG_ENV_ADDR_REDUND;
static ulong end_addr_new = CONFIG_ENV_ADDR_REDUND + CONFIG_ENV_SECT_SIZE - 1; static ulong end_addr_new = CONFIG_ENV_ADDR_REDUND + CONFIG_ENV_SECT_SIZE - 1;
#endif /* CONFIG_ENV_ADDR_REDUND */ #endif /* CONFIG_ENV_ADDR_REDUND */
extern uchar default_environment[]; extern const uchar default_environment[];
uchar env_get_char_spec(int index) uchar env_get_char_spec(int index)

View file

@ -160,7 +160,7 @@ extern struct hsearch_data env_htab;
unsigned char env_get_char (int); unsigned char env_get_char (int);
/* Function that returns a pointer to a value from the environment */ /* Function that returns a pointer to a value from the environment */
unsigned char *env_get_addr(int); const unsigned char *env_get_addr(int);
unsigned char env_get_char_memory (int index); unsigned char env_get_char_memory (int index);
/* Function that updates CRC of the enironment */ /* Function that updates CRC of the enironment */