misc: _char_out can be a static symbol

Fixes sparse warning:
<snip>/zephyr/zephyr/misc/printk.c:50:5: warning: symbol '_char_out' was not declared. Should it be static?

Change-Id: I5af0860e9f8f827002ae9a142b5924d3de8d51b6
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
This commit is contained in:
Maciek Borzecki 2017-05-18 11:05:42 +02:00 committed by Kumar Gala
commit fed96bf1bc
2 changed files with 5 additions and 4 deletions

View file

@ -47,7 +47,7 @@ static int _nop_char_out(int c)
return 0;
}
int (*_char_out)(int) = _nop_char_out;
static int (*_char_out)(int) = _nop_char_out;
/**
* @brief Install the character output routine for printk

View file

@ -11,7 +11,8 @@
static int pos;
char ram_console[BUF_SZ];
extern int (*_char_out)(int);
void __printk_hook_install(int (*fn)(int));
void *__printk_get_hook(void);
int (*_old_char_out)(int);
char *expected = "22 113 10000 32768 40000 22\n"
@ -60,8 +61,8 @@ void printk_test(void)
{
int count;
_old_char_out = _char_out;
_char_out = ram_console_out;
_old_char_out = __printk_get_hook();
__printk_hook_install(ram_console_out);
printk("%zu %hhu %hu %u %lu %llu\n", stv, uc, usi, ui, ul, ull);
printk("%c %hhd %hd %d %ld %lld\n", c, c, ssi, si, sl, sll);