Skip to content

Commit

Permalink
printk: Export _vprintk similar to how _prf is exported
Browse files Browse the repository at this point in the history
There are some corner cases where direct access to the formatter
function is needed. Export _vprintk() so code can use it in a similar
way that _prf() can be directly used.

Change-Id: I9dfb68f87f310e900c662dc8beb320bb4ff7d8b2
Signed-off-by: Johan Hedberg <[email protected]>
  • Loading branch information
Johan Hedberg authored and Anas Nashif committed Dec 11, 2016
1 parent 57e1975 commit 244a4df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions include/misc/printk.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ extern __printf_like(1, 2) int printk(const char *fmt, ...);
extern __printf_like(3, 4) int snprintk(char *str, size_t size,
const char *fmt, ...);
extern int vsnprintk(char *str, size_t size, const char *fmt, va_list ap);

void _vprintk(int (*out)(int, void *), void *ctx, const char *fmt, va_list ap);
#else
static inline __printf_like(1, 2) int printk(const char *fmt, ...)
{
Expand Down
3 changes: 1 addition & 2 deletions misc/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ void __printk_hook_install(int (*fn)(int))
*
* @return N/A
*/
static inline void _vprintk(out_func_t out, void *ctx, const char *fmt,
va_list ap)
void _vprintk(out_func_t out, void *ctx, const char *fmt, va_list ap)
{
int might_format = 0; /* 1 if encountered a '%' */
int pad_zero = 0;
Expand Down

0 comments on commit 244a4df

Please sign in to comment.