diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/cbmem_console.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/lib/cbmem_console.c b/src/lib/cbmem_console.c index 1b584028b4..819c27f42d 100644 --- a/src/lib/cbmem_console.c +++ b/src/lib/cbmem_console.c @@ -195,27 +195,27 @@ static void copy_console_buffer(struct cbmem_console *new_cons_p) static void cbmemc_reinit_(void) { - struct cbmem_console *cbm_cons_p; + struct cbmem_console *cbm_cons_p = NULL; + +#ifndef __PRE_RAM__ + cbm_cons_p = cbmem_find(CBMEM_ID_CONSOLE); +#endif -#ifdef __PRE_RAM__ - cbm_cons_p = cbmem_add(CBMEM_ID_CONSOLE, - CONFIG_CONSOLE_CBMEM_BUFFER_SIZE); if (!cbm_cons_p) { - current_console_set(NULL); - return; - } + cbm_cons_p = cbmem_add(CBMEM_ID_CONSOLE, + CONFIG_CONSOLE_CBMEM_BUFFER_SIZE); - cbm_cons_p->buffer_size = CONFIG_CONSOLE_CBMEM_BUFFER_SIZE - - sizeof(struct cbmem_console); + if (!cbm_cons_p) { + current_console_set(NULL); + return; + } - cbm_cons_p->buffer_cursor = 0; -#else - cbm_cons_p = cbmem_find(CBMEM_ID_CONSOLE); + cbm_cons_p->buffer_size = CONFIG_CONSOLE_CBMEM_BUFFER_SIZE - + sizeof(struct cbmem_console); - if (!cbm_cons_p) - return; + cbm_cons_p->buffer_cursor = 0; + } -#endif copy_console_buffer(cbm_cons_p); current_console_set(cbm_cons_p); |