From fe83035474e50efc505d0c1f9433fea047407b36 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Wed, 22 Jan 2020 14:03:41 -0600 Subject: [PATCH] logging: Added explicit casts of buffer in hexdump delegates Since the various delegates have different data types for their parameters, this makes the call into this macro a little simpler (alleviating the need for each call to know how it'll be handed off down the chain). Signed-off-by: Erik Johnson --- include/logging/log_core.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/include/logging/log_core.h b/include/logging/log_core.h index 7dd4e331032..202638fc283 100644 --- a/include/logging/log_core.h +++ b/include/logging/log_core.h @@ -308,7 +308,8 @@ static inline char z_log_minimal_level_to_char(int level) if (Z_LOG_CONST_LEVEL_CHECK(_level)) { \ if (IS_ENABLED(CONFIG_LOG_MINIMAL)) { \ Z_LOG_TO_PRINTK(_level, "%s", _str); \ - log_minimal_hexdump_print(_level, _data, \ + log_minimal_hexdump_print(_level, \ + (const char *)_data, \ _length); \ } else if (is_user_context || \ (_level <= LOG_RUNTIME_FILTER(_filter))) { \ @@ -320,12 +321,15 @@ static inline char z_log_minimal_level_to_char(int level) \ if (is_user_context) { \ log_hexdump_from_user(src_level, _str, \ - _data, _length); \ + (const char *)_data, \ + _length); \ } else if (IS_ENABLED(CONFIG_LOG_IMMEDIATE)) { \ log_hexdump_sync(src_level, _str, \ - _data, _length); \ + (const char *)_data, \ + _length); \ } else { \ - log_hexdump(_str, _data, _length, \ + log_hexdump(_str, (const char *)_data, \ + _length, \ src_level); \ } \ } \