提交 27b4225b 编写于 作者: T Tom Rini

stdio_names: Ensure MAX_NAMES is defined before use, don't use 3 directly

With tighter build flags the fact that <stdio_dev.h> doesn't have a
reference back to MAX_NAMES causes an error.  Include <stdio.h> here and
then in common/console.c use MAX_NAMES rather than 3 when working with
stdio_names.
Reported-by: NPeter Robinson <pbrobinson@gmail.com>
Signed-off-by: NTom Rini <trini@konsulko.com>
Tested-by: NPeter Robinson <pbrobinson@gmail.com>
上级 dba8070f
......@@ -847,7 +847,7 @@ done:
#ifdef CONFIG_SYS_CONSOLE_ENV_OVERWRITE
/* set the environment variables (will overwrite previous env settings) */
for (i = 0; i < 3; i++) {
for (i = 0; i < MAX_FILES; i++) {
env_set(stdio_names[i], stdio_devices[i]->name);
}
#endif /* CONFIG_SYS_CONSOLE_ENV_OVERWRITE */
......@@ -926,7 +926,7 @@ int console_init_r(void)
#endif /* CONFIG_SYS_CONSOLE_INFO_QUIET */
/* Setting environment variables */
for (i = 0; i < 3; i++) {
for (i = 0; i < MAX_FILES; i++) {
env_set(stdio_names[i], stdio_devices[i]->name);
}
......
......@@ -8,6 +8,7 @@
#ifndef _STDIO_DEV_H_
#define _STDIO_DEV_H_
#include <stdio.h>
#include <linux/list.h>
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册