From 7f6cb66dc0059ffc63fb4220d75176c4a2165d2c Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Wed, 2 Aug 2023 11:02:07 +0200 Subject: [PATCH] note_driver.c: fix warning CC: note/note_driver.c note/note_driver.c:180:19: warning: 'g_note_lock' defined but not used [-Wunused-variable] 180 | static spinlock_t g_note_lock; | --- drivers/note/note_driver.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/note/note_driver.c b/drivers/note/note_driver.c index fc079c11fd..66b4f01428 100644 --- a/drivers/note/note_driver.c +++ b/drivers/note/note_driver.c @@ -177,7 +177,10 @@ FAR static struct note_driver_s * static struct note_taskname_s g_note_taskname; #endif +#if defined(CONFIG_SCHED_INSTRUMENTATION_FILTER) || \ + (CONFIG_DRIVERS_NOTE_TASKNAME_BUFSIZE > 0) static spinlock_t g_note_lock; +#endif /**************************************************************************** * Private Functions @@ -1892,7 +1895,7 @@ void sched_note_filter_irq(FAR struct note_filter_irq_s *oldf, * ****************************************************************************/ -# ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP +#ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP void sched_note_filter_tag(FAR struct note_filter_tag_s *oldf, FAR struct note_filter_tag_s *newf) { @@ -1916,7 +1919,7 @@ void sched_note_filter_tag(FAR struct note_filter_tag_s *oldf, spin_unlock_irqrestore_wo_note(&g_note_lock, falgs); } -# endif +#endif #endif /* CONFIG_SCHED_INSTRUMENTATION_FILTER */