mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-12 13:35:21 -04:00
env: clean env_common.c checkpatch and code style
Cleanup the env_common.c checkpatch warnings, errors and coding style. Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
This commit is contained in:
parent
de152b9bf8
commit
27aafe988e
@ -34,13 +34,6 @@
|
|||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
extern env_t *env_ptr;
|
|
||||||
|
|
||||||
extern void env_relocate_spec (void);
|
|
||||||
extern uchar env_get_char_spec(int);
|
|
||||||
|
|
||||||
static uchar env_get_char_init (int index);
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Default settings to be used when no valid environment is found
|
* Default settings to be used when no valid environment is found
|
||||||
*/
|
*/
|
||||||
@ -133,15 +126,11 @@ struct hsearch_data env_htab;
|
|||||||
|
|
||||||
static uchar env_get_char_init(int index)
|
static uchar env_get_char_init(int index)
|
||||||
{
|
{
|
||||||
uchar c;
|
|
||||||
|
|
||||||
/* if crc was bad, use the default environment */
|
/* if crc was bad, use the default environment */
|
||||||
if (gd->env_valid)
|
if (gd->env_valid)
|
||||||
c = env_get_char_spec(index);
|
return env_get_char_spec(index);
|
||||||
else
|
else
|
||||||
c = default_environment[index];
|
return default_environment[index];
|
||||||
|
|
||||||
return (c);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uchar env_get_char_memory(int index)
|
uchar env_get_char_memory(int index)
|
||||||
@ -151,15 +140,11 @@ uchar env_get_char_memory (int index)
|
|||||||
|
|
||||||
uchar env_get_char(int index)
|
uchar env_get_char(int index)
|
||||||
{
|
{
|
||||||
uchar c;
|
|
||||||
|
|
||||||
/* if relocated to RAM */
|
/* if relocated to RAM */
|
||||||
if (gd->flags & GD_FLG_RELOC)
|
if (gd->flags & GD_FLG_RELOC)
|
||||||
c = env_get_char_memory(index);
|
return env_get_char_memory(index);
|
||||||
else
|
else
|
||||||
c = env_get_char_init(index);
|
return env_get_char_init(index);
|
||||||
|
|
||||||
return (c);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const uchar *env_get_addr(int index)
|
const uchar *env_get_addr(int index)
|
||||||
@ -190,9 +175,9 @@ void set_default_env(const char *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (himport_r(&env_htab, (char *)default_environment,
|
if (himport_r(&env_htab, (char *)default_environment,
|
||||||
sizeof(default_environment), '\0', 0) == 0) {
|
sizeof(default_environment), '\0', 0) == 0)
|
||||||
error("Environment import failed: errno = %d\n", errno);
|
error("Environment import failed: errno = %d\n", errno);
|
||||||
}
|
|
||||||
gd->flags |= GD_FLG_ENV_READY;
|
gd->flags |= GD_FLG_ENV_READY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,8 +215,6 @@ int env_import(const char *buf, int check)
|
|||||||
void env_relocate(void)
|
void env_relocate(void)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_NEEDS_MANUAL_RELOC)
|
#if defined(CONFIG_NEEDS_MANUAL_RELOC)
|
||||||
extern void env_reloc(void);
|
|
||||||
|
|
||||||
env_reloc();
|
env_reloc();
|
||||||
#endif
|
#endif
|
||||||
if (gd->env_valid == 0) {
|
if (gd->env_valid == 0) {
|
||||||
@ -272,6 +255,7 @@ int env_complete(char *var, int maxv, char *cmdv[], int bufsz, char *buf)
|
|||||||
|
|
||||||
if (idx)
|
if (idx)
|
||||||
cmdv[found++] = "...";
|
cmdv[found++] = "...";
|
||||||
|
|
||||||
cmdv[found] = NULL;
|
cmdv[found] = NULL;
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
@ -162,6 +162,14 @@ extern env_t environment;
|
|||||||
#endif /* ENV_IS_EMBEDDED */
|
#endif /* ENV_IS_EMBEDDED */
|
||||||
|
|
||||||
extern const unsigned char default_environment[];
|
extern const unsigned char default_environment[];
|
||||||
|
extern env_t *env_ptr;
|
||||||
|
|
||||||
|
extern void env_relocate_spec(void);
|
||||||
|
extern unsigned char env_get_char_spec(int);
|
||||||
|
|
||||||
|
#if defined(CONFIG_NEEDS_MANUAL_RELOC)
|
||||||
|
extern void env_reloc(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef DO_DEPS_ONLY
|
#ifndef DO_DEPS_ONLY
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user