fix(console): correct scopes for console symbols

console_state is only used in multi_console.c, it is then declared as
static. console_list is used by several files, declare it as extern.
This corrects the 2 sparse warnings:
drivers/console/multi_console.c:13:11: warning: symbol 'console_list'
 was not declared. Should it be static?
drivers/console/multi_console.c:14:9: warning: symbol 'console_state'
 was not declared. Should it be static?

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Id1891595906c258e8cb8aa325226f0a43723ca0e
This commit is contained in:
Yann Gautier 2022-12-09 14:30:55 +01:00
parent 654b65b36d
commit 03bd48102b
2 changed files with 5 additions and 3 deletions

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2018-2020, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2018-2023, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
@ -11,7 +11,7 @@
#include <drivers/console.h> #include <drivers/console.h>
console_t *console_list; console_t *console_list;
uint8_t console_state = CONSOLE_FLAG_BOOT; static uint8_t console_state = CONSOLE_FLAG_BOOT;
IMPORT_SYM(console_t *, __STACKS_START__, stacks_start) IMPORT_SYM(console_t *, __STACKS_START__, stacks_start)
IMPORT_SYM(console_t *, __STACKS_END__, stacks_end) IMPORT_SYM(console_t *, __STACKS_END__, stacks_end)

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2020, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2013-2023, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
@ -48,6 +48,8 @@ typedef struct console {
/* Additional private driver data may follow here. */ /* Additional private driver data may follow here. */
} console_t; } console_t;
extern console_t *console_list;
/* offset macro assertions for console_t */ /* offset macro assertions for console_t */
#include <drivers/console_assertions.h> #include <drivers/console_assertions.h>