@@ -53,7 +53,7 @@ int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char * const argv[])
for (l = 0; l < MAX_FILES; l++) {
sio = stdio_get_fd(l);
if (sio == dev)
- printf("%s ", stdio_names[l]);
+ printf("%s ", stdio_fd_to_name(l));
}
putc ('\n');
}
@@ -706,7 +706,7 @@ done:
for (i = 0; i < 3; i++) {
sio = stdio_get_fd(i);
if (sio)
- setenv(stdio_names[i], sio->name);
+ setenv(stdio_fd_to_name(i), sio->name);
}
#endif /* CONFIG_SYS_CONSOLE_ENV_OVERWRITE */
@@ -777,7 +777,7 @@ int console_init_r(void)
for (i = 0; i < 3; i++) {
sio = stdio_get_fd(i);
if (sio)
- setenv(stdio_names[i], sio->name);
+ setenv(stdio_fd_to_name(i), sio->name);
}
return 0;
@@ -39,7 +39,11 @@ DECLARE_GLOBAL_DATA_PTR;
static struct stdio_dev devs;
static struct stdio_dev *stdio_devices[] = { NULL, NULL, NULL };
-char *stdio_names[MAX_FILES] = { "stdin", "stdout", "stderr" };
+static const char * const stdio_names[MAX_FILES] = {
+ "stdin",
+ "stdout",
+ "stderr"
+};
#if defined(CONFIG_SPLASH_SCREEN) && !defined(CONFIG_SYS_DEVICE_NULLDEV)
#define CONFIG_SYS_DEVICE_NULLDEV 1
@@ -81,11 +81,6 @@ typedef struct {
} video_ext_t;
/*
- * VARIABLES
- */
-extern char *stdio_names[MAX_FILES];
-
-/*
* PROTOTYPES
*/
int stdio_register (struct stdio_dev * dev);
The stdio_names variable is no longer exported. Now it's properly constified and accessed via stdio_fd_to_name call. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Wolfgang Denk <wd@denx.de> --- common/cmd_console.c | 2 +- common/console.c | 4 ++-- common/stdio.c | 6 +++++- include/stdio_dev.h | 5 ----- 4 files changed, 8 insertions(+), 9 deletions(-)