From cfb8c413c9bc1786ddf408cf655e4141dd771673 Mon Sep 17 00:00:00 2001 From: daopingl Date: Fri, 27 May 2022 17:58:36 +0800 Subject: [PATCH] msm: camera: utils: modify debug function logic there are only 8k stack in 32 bit system, this change used to make the temp variables be contorl by the parameters, which can decrase the stack resource cost under default debug settings and finally improve the stability of multi camera cases. CRs-fixed: 3193708 Change-Id: If0f33cc310d64c83c0e4781a5de61483ebc35769 Signed-off-by: daopingl --- drivers/cam_utils/cam_debug_util.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/cam_utils/cam_debug_util.c b/drivers/cam_utils/cam_debug_util.c index d4ea078119c9..5f1a3f7f4876 100644 --- a/drivers/cam_utils/cam_debug_util.c +++ b/drivers/cam_utils/cam_debug_util.c @@ -257,12 +257,11 @@ const char *cam_get_tag_name(unsigned int tag_id) void cam_debug_log(unsigned int module_id, const char *func, const int line, const char *fmt, ...) { - char str_buffer[STR_BUFFER_MAX_LENGTH]; - va_list args; - - va_start(args, fmt); - if (debug_mdl & module_id) { + char str_buffer[STR_BUFFER_MAX_LENGTH]; + va_list args; + + va_start(args, fmt); vsnprintf(str_buffer, STR_BUFFER_MAX_LENGTH, fmt, args); if ((debug_type == 0) || (debug_type == 2)) { @@ -281,9 +280,9 @@ void cam_debug_log(unsigned int module_id, const char *func, const int line, func, line, str_buffer); trace_cam_log_debug(trace_buffer); } - } - va_end(args); + va_end(args); + } } void cam_debug_trace(unsigned int tag, unsigned int module_id,