From 0acca0f834e8eb418f74b888b4d2d69906e3da45 Mon Sep 17 00:00:00 2001 From: Jyri Sarha Date: Mon, 16 Sep 2024 22:25:02 +0300 Subject: [PATCH 1/2] debug: debug_stream_slot: Fix couple of warnings Fix one "unused variable" and one "may be used uninitialized" warning. The maybe used is false positive, but still better to silence it. Signed-off-by: Jyri Sarha --- src/debug/debug_stream/debug_stream_slot.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/debug/debug_stream/debug_stream_slot.c b/src/debug/debug_stream/debug_stream_slot.c index 3e95eae0edb2..bf8a593a348e 100644 --- a/src/debug/debug_stream/debug_stream_slot.c +++ b/src/debug/debug_stream/debug_stream_slot.c @@ -32,7 +32,6 @@ struct debug_stream_circular_buf * debug_stream_get_circular_buffer(struct debug_stream_section_descriptor *desc, unsigned int core) { struct debug_stream_slot_hdr *hdr = debug_stream_get_slot(); - void *ptr; if (hdr->hdr.magic != DEBUG_STREAM_IDENTIFIER) { LOG_ERR("Debug stream slot not initialized."); @@ -47,7 +46,7 @@ debug_stream_get_circular_buffer(struct debug_stream_section_descriptor *desc, u int debug_stream_slot_send_record(struct debug_stream_record *rec) { - struct debug_stream_section_descriptor desc; + struct debug_stream_section_descriptor desc = { 0 }; struct debug_stream_circular_buf *buf = debug_stream_get_circular_buffer(&desc, arch_proc_id()); uint32_t record_size = rec->size_words; @@ -134,7 +133,7 @@ static int debug_stream_slot_init(void) offset += section_size; } for (i = 0; i < CONFIG_MP_MAX_NUM_CPUS; i++) { - struct debug_stream_section_descriptor desc; + struct debug_stream_section_descriptor desc = { 0 }; struct debug_stream_circular_buf *buf = debug_stream_get_circular_buffer(&desc, i); From 3634d9e1811ef8556578bfc99c982e4b0b1a8132 Mon Sep 17 00:00:00 2001 From: Jyri Sarha Date: Mon, 16 Sep 2024 22:28:14 +0300 Subject: [PATCH 2/2] debug: debug_stream_thread_info: Silence "unused variable" warning Signed-off-by: Jyri Sarha --- src/debug/debug_stream/debug_stream_thread_info.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/debug/debug_stream/debug_stream_thread_info.c b/src/debug/debug_stream/debug_stream_thread_info.c index 200e2c5e0dc4..a4cb056ec2ac 100644 --- a/src/debug/debug_stream/debug_stream_thread_info.c +++ b/src/debug/debug_stream/debug_stream_thread_info.c @@ -122,7 +122,6 @@ static uint8_t thread_info_cpu_utilization(struct k_thread *thread, { k_thread_runtime_stats_t thread_stats; uint32_t cycles; - int ret; if (!ud->stats_valid) return 0;