aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek BehĂșn <marek.behun@nic.cz>2021-10-22 15:47:24 +0200
committerSimon Glass <sjg@chromium.org>2021-10-31 12:26:44 -0600
commitc5cbbe35fd7b3d05273f4d3f273c9e613bd38d7d (patch)
treee44ca7574da59b965ccb5937dbadfcc679314fd0
parentb26334824b58150e82a8b202380169a9276cd161 (diff)
downloadu-boot-c5cbbe35fd7b3d05273f4d3f273c9e613bd38d7d.zip
u-boot-c5cbbe35fd7b3d05273f4d3f273c9e613bd38d7d.tar.gz
u-boot-c5cbbe35fd7b3d05273f4d3f273c9e613bd38d7d.tar.bz2
env: Always use char for default_environment
Sometimes we use uchar and sometimes char for the default environment array. By always using char, we can get rid of some explicit casts. Signed-off-by: Marek BehĂșn <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--board/Marvell/mvebu_armada-37xx/board.c2
-rw-r--r--env/common.c6
-rw-r--r--include/env_default.h4
-rw-r--r--include/env_internal.h4
4 files changed, 8 insertions, 8 deletions
diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c
index 2de9c2a..d7b6eca 100644
--- a/board/Marvell/mvebu_armada-37xx/board.c
+++ b/board/Marvell/mvebu_armada-37xx/board.c
@@ -87,7 +87,7 @@ int board_init(void)
#ifdef CONFIG_BOARD_LATE_INIT
int board_late_init(void)
{
- char *ptr = (char *)&default_environment[0];
+ char *ptr = &default_environment[0];
struct udevice *dev;
struct mmc *mmc_dev;
bool ddr4, emmc;
diff --git a/env/common.c b/env/common.c
index db213b7..664d2e6 100644
--- a/env/common.c
+++ b/env/common.c
@@ -162,7 +162,7 @@ int env_get_f(const char *name, char *buf, unsigned len)
name_len = strlen(name);
if (gd->env_valid == ENV_INVALID)
- env = (const char *)default_environment;
+ env = default_environment;
else
env = (const char *)gd->env_addr;
@@ -264,7 +264,7 @@ void env_set_default(const char *s, int flags)
}
flags |= H_DEFAULT;
- if (himport_r(&env_htab, (char *)default_environment,
+ if (himport_r(&env_htab, default_environment,
sizeof(default_environment), '\0', flags, 0,
0, NULL) == 0)
pr_err("## Error: Environment import failed: errno = %d\n",
@@ -283,7 +283,7 @@ int env_set_default_vars(int nvars, char * const vars[], int flags)
* (and use \0 as a separator)
*/
flags |= H_NOCLEAR | H_DEFAULT;
- return himport_r(&env_htab, (const char *)default_environment,
+ return himport_r(&env_htab, default_environment,
sizeof(default_environment), '\0',
flags, 0, nvars, vars);
}
diff --git a/include/env_default.h b/include/env_default.h
index 66e203e..a672471 100644
--- a/include/env_default.h
+++ b/include/env_default.h
@@ -20,9 +20,9 @@ env_t embedded_environment __UBOOT_ENV_SECTION__(environment) = {
#elif defined(DEFAULT_ENV_INSTANCE_STATIC)
static char default_environment[] = {
#elif defined(DEFAULT_ENV_IS_RW)
-uchar default_environment[] = {
+char default_environment[] = {
#else
-const uchar default_environment[] = {
+const char default_environment[] = {
#endif
#ifndef CONFIG_USE_DEFAULT_ENV_FILE
#ifdef CONFIG_ENV_CALLBACK_LIST_DEFAULT
diff --git a/include/env_internal.h b/include/env_internal.h
index b7bddcb..f74927c 100644
--- a/include/env_internal.h
+++ b/include/env_internal.h
@@ -112,9 +112,9 @@ extern env_t embedded_environment;
#endif /* ENV_IS_EMBEDDED */
#ifdef DEFAULT_ENV_IS_RW
-extern unsigned char default_environment[];
+extern char default_environment[];
#else
-extern const unsigned char default_environment[];
+extern const char default_environment[];
#endif
#ifndef DO_DEPS_ONLY