Commit bcdfb8d5a531fbc65dceb60b4205f5a0fbd49a97

Authored by Simon Glass
Committed by Tom Rini
1 parent 91d3aa05d0

env: common: Make env_get_addr/get_char_memory() static

These functions are not used outside this file. Make them static and order
them to avoid forward declarations.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

Showing 2 changed files with 9 additions and 13 deletions Side-by-side Diff

... ... @@ -41,8 +41,16 @@
41 41 return default_environment[index];
42 42 }
43 43  
44   -uchar env_get_char_memory(int index)
  44 +static const uchar *env_get_addr(int index)
45 45 {
  46 + if (gd->env_valid)
  47 + return (uchar *)(gd->env_addr + index);
  48 + else
  49 + return &default_environment[index];
  50 +}
  51 +
  52 +static uchar env_get_char_memory(int index)
  53 +{
46 54 return *env_get_addr(index);
47 55 }
48 56  
... ... @@ -53,14 +61,6 @@
53 61 return env_get_char_memory(index);
54 62 else
55 63 return env_get_char_init(index);
56   -}
57   -
58   -const uchar *env_get_addr(int index)
59   -{
60   - if (gd->env_valid)
61   - return (uchar *)(gd->env_addr + index);
62   - else
63   - return &default_environment[index];
64 64 }
65 65  
66 66 /*
include/environment.h
... ... @@ -202,10 +202,6 @@
202 202 /* Function that returns a character from the environment */
203 203 unsigned char env_get_char(int);
204 204  
205   -/* Function that returns a pointer to a value from the environment */
206   -const unsigned char *env_get_addr(int);
207   -unsigned char env_get_char_memory(int index);
208   -
209 205 /* Function that updates CRC of the enironment */
210 206 void env_crc_update(void);
211 207