diff options
| author | Igor Grinberg <grinberg@compulab.co.il> | 2011-12-26 03:33:10 +0000 | 
|---|---|---|
| committer | Wolfgang Denk <wd@denx.de> | 2012-01-05 16:34:10 +0100 | 
| commit | bf95df44ff69e3e365603e3e30664ec41bfe0c65 (patch) | |
| tree | d6727b154fb2e17279acb141cd2975f60b243f10 /common/env_common.c | |
| parent | 33e1e01820f9a1e19ab18c8791f3b2dc09165e2b (diff) | |
| download | olio-uboot-2014.01-bf95df44ff69e3e365603e3e30664ec41bfe0c65.tar.xz olio-uboot-2014.01-bf95df44ff69e3e365603e3e30664ec41bfe0c65.zip | |
env: factor out the env_get_char_spec() function
env_get_char_spec() function is duplicated across multiple environment
files.
Remove the duplication by providing a default implementation.
Add "weak" declaration, so the default implementation can be overridden.
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Diffstat (limited to 'common/env_common.c')
| -rw-r--r-- | common/env_common.c | 7 | 
1 files changed, 7 insertions, 0 deletions
| diff --git a/common/env_common.c b/common/env_common.c index 8a7109645..71811c4d2 100644 --- a/common/env_common.c +++ b/common/env_common.c @@ -124,6 +124,13 @@ const uchar default_environment[] = {  struct hsearch_data env_htab; +static uchar __env_get_char_spec(int index) +{ +	return *((uchar *)(gd->env_addr + index)); +} +uchar env_get_char_spec(int) +	__attribute__((weak, alias("__env_get_char_spec"))); +  static uchar env_get_char_init(int index)  {  	/* if crc was bad, use the default environment */ |