Hello Martin Roth, Marc Jones, Johnny Lin, Angel Pons, Kyösti Mälkki,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/45765
to review the following change.
Change subject: console/init: Drop CONSOLE_LEVEL_CONST ......................................................................
console/init: Drop CONSOLE_LEVEL_CONST
We limited the configurability of the debug level to stages that have a `.data` section. This is not really a requirement, because a `.bss` section should suffice and we always have that now.
Making the debug level always configurable, adds an early call to get_option(). But that shouldn't hurt: The value is cached locally.
Change-Id: I11484fc32dcbba8d31772bd0b82785f17b2fba11 Signed-off-by: Nico Huber nico.h@gmx.de --- M src/console/init.c 1 file changed, 2 insertions(+), 18 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/65/45765/1
diff --git a/src/console/init.c b/src/console/init.c index 1dba9ad..9776e2a 100644 --- a/src/console/init.c +++ b/src/console/init.c @@ -8,40 +8,24 @@ #include <option.h> #include <version.h>
-/* Mutable console log level only allowed when RAM comes online. */ -#define CONSOLE_LEVEL_CONST !ENV_STAGE_HAS_DATA_SECTION - static int console_inited; -static int console_loglevel = CONFIG_DEFAULT_CONSOLE_LOGLEVEL; +static int console_loglevel;
static inline int get_log_level(void) { if (console_inited == 0) return -1; - if (CONSOLE_LEVEL_CONST) - return get_console_loglevel();
return console_loglevel; }
-static inline void set_log_level(int new_level) -{ - if (CONSOLE_LEVEL_CONST) - return; - - console_loglevel = new_level; -} - static void init_log_level(void) { int debug_level = get_console_loglevel();
- if (CONSOLE_LEVEL_CONST) - return; - get_option(&debug_level, "debug_level");
- set_log_level(debug_level); + console_loglevel = debug_level; }
int console_log_level(int msg_level)