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>
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 @@
#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 @@
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 @@
}
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 @@
* (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 @@
#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 @@
#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