You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/08/05 08:20:55 UTC
(nuttx) 03/06: spinlock: fix unused parameter
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 500ebd6498f55ac2fef261218930849011aaf957
Author: chao an <an...@lixiang.com>
AuthorDate: Sun Aug 4 20:38:36 2024 +0800
spinlock: fix unused parameter
fix unused parameter if unlock spinlock from different function
Signed-off-by: chao an <an...@lixiang.com>
---
include/nuttx/spinlock.h | 8 ++++----
sched/irq/irq_spinlock.c | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/nuttx/spinlock.h b/include/nuttx/spinlock.h
index 0e0b84bc18..195496d558 100644
--- a/include/nuttx/spinlock.h
+++ b/include/nuttx/spinlock.h
@@ -589,7 +589,7 @@ irqstate_t spin_lock_irqsave_wo_note(FAR spinlock_t *lock);
#if defined(CONFIG_SPINLOCK)
void spin_unlock_irqrestore(FAR spinlock_t *lock, irqstate_t flags);
#else
-# define spin_unlock_irqrestore(l, f) up_irq_restore(f)
+# define spin_unlock_irqrestore(l, f) ((void)(l), up_irq_restore(f))
#endif
/****************************************************************************
@@ -599,7 +599,7 @@ void spin_unlock_irqrestore(FAR spinlock_t *lock, irqstate_t flags);
#if defined(CONFIG_SPINLOCK)
void spin_unlock_irqrestore_wo_note(FAR spinlock_t *lock, irqstate_t flags);
#else
-# define spin_unlock_irqrestore_wo_note(l, f) up_irq_restore(f)
+# define spin_unlock_irqrestore_wo_note(l, f) ((void)(l), up_irq_restore(f))
#endif
#if defined(CONFIG_RW_SPINLOCK)
@@ -914,7 +914,7 @@ irqstate_t read_lock_irqsave(FAR rwlock_t *lock);
#if defined(CONFIG_SPINLOCK)
void read_unlock_irqrestore(FAR rwlock_t *lock, irqstate_t flags);
#else
-# define read_unlock_irqrestore(l, f) up_irq_restore(f)
+# define read_unlock_irqrestore(l, f) ((void)(l), up_irq_restore(f))
#endif
/****************************************************************************
@@ -988,7 +988,7 @@ irqstate_t write_lock_irqsave(FAR rwlock_t *lock);
#if defined(CONFIG_SPINLOCK)
void write_unlock_irqrestore(FAR rwlock_t *lock, irqstate_t flags);
#else
-# define write_unlock_irqrestore(l, f) up_irq_restore(f)
+# define write_unlock_irqrestore(l, f) ((void)(l), up_irq_restore(f))
#endif
#endif /* CONFIG_RW_SPINLOCK */
diff --git a/sched/irq/irq_spinlock.c b/sched/irq/irq_spinlock.c
index efbf820234..17559b271e 100644
--- a/sched/irq/irq_spinlock.c
+++ b/sched/irq/irq_spinlock.c
@@ -196,7 +196,7 @@ void spin_unlock_irqrestore(spinlock_t *lock, irqstate_t flags)
}
/****************************************************************************
- * Name: spin_lock_irqsave_wo_note
+ * Name: spin_unlock_irqrestore_wo_note
****************************************************************************/
void spin_unlock_irqrestore_wo_note(spinlock_t *lock, irqstate_t flags)