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>
This commit is contained in:
committed by
Wolfgang Denk
parent
33e1e01820
commit
bf95df44ff
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user