logging: remove return value from log_printk()
printk() doesn't return a value, this doesn't need to either. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
638f480b35
commit
d6d3f152b3
2 changed files with 5 additions and 11 deletions
|
@ -257,10 +257,8 @@ extern "C" {
|
||||||
*
|
*
|
||||||
* @param fmt Formatted string to output.
|
* @param fmt Formatted string to output.
|
||||||
* @param ap Variable parameters.
|
* @param ap Variable parameters.
|
||||||
*
|
|
||||||
* return Number of bytes written.
|
|
||||||
*/
|
*/
|
||||||
int log_printk(const char *fmt, va_list ap);
|
void log_printk(const char *fmt, va_list ap);
|
||||||
|
|
||||||
/** @brief Copy transient string to a buffer from internal, logger pool.
|
/** @brief Copy transient string to a buffer from internal, logger pool.
|
||||||
*
|
*
|
||||||
|
|
|
@ -320,10 +320,8 @@ void log_hexdump(const char *str,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int log_printk(const char *fmt, va_list ap)
|
void log_printk(const char *fmt, va_list ap)
|
||||||
{
|
{
|
||||||
int length = 0;
|
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_LOG_PRINTK)) {
|
if (IS_ENABLED(CONFIG_LOG_PRINTK)) {
|
||||||
union {
|
union {
|
||||||
struct log_msg_ids structure;
|
struct log_msg_ids structure;
|
||||||
|
@ -337,8 +335,7 @@ int log_printk(const char *fmt, va_list ap)
|
||||||
if (_is_user_context()) {
|
if (_is_user_context()) {
|
||||||
u8_t str[CONFIG_LOG_PRINTK_MAX_STRING_LENGTH + 1];
|
u8_t str[CONFIG_LOG_PRINTK_MAX_STRING_LENGTH + 1];
|
||||||
|
|
||||||
length = vsnprintk(str, sizeof(str), fmt, ap);
|
vsnprintk(str, sizeof(str), fmt, ap);
|
||||||
length = MIN(length, sizeof(str));
|
|
||||||
|
|
||||||
z_log_string_from_user(src_level_union.value, str);
|
z_log_string_from_user(src_level_union.value, str);
|
||||||
} else if (IS_ENABLED(CONFIG_LOG_IMMEDIATE)) {
|
} else if (IS_ENABLED(CONFIG_LOG_IMMEDIATE)) {
|
||||||
|
@ -346,20 +343,19 @@ int log_printk(const char *fmt, va_list ap)
|
||||||
} else {
|
} else {
|
||||||
u8_t str[CONFIG_LOG_PRINTK_MAX_STRING_LENGTH + 1];
|
u8_t str[CONFIG_LOG_PRINTK_MAX_STRING_LENGTH + 1];
|
||||||
struct log_msg *msg;
|
struct log_msg *msg;
|
||||||
|
int length;
|
||||||
|
|
||||||
length = vsnprintk(str, sizeof(str), fmt, ap);
|
length = vsnprintk(str, sizeof(str), fmt, ap);
|
||||||
length = MIN(length, sizeof(str));
|
length = MIN(length, sizeof(str));
|
||||||
|
|
||||||
msg = log_msg_hexdump_create(NULL, str, length);
|
msg = log_msg_hexdump_create(NULL, str, length);
|
||||||
if (msg == NULL) {
|
if (msg == NULL) {
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
msg_finalize(msg, src_level_union.structure);
|
msg_finalize(msg, src_level_union.structure);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return length;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @brief Count number of arguments in formatted string.
|
/** @brief Count number of arguments in formatted string.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue