This is an automated email from the ASF dual-hosted git repository.

GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 25d27410768d491929a50597251b46f0734522d1
Author: Bowen Wang <[email protected]>
AuthorDate: Thu Nov 26 10:57:17 2026 +0800

    include/nuttx/spinlock.h: use the count in the stub rspin_restorelock()
    
    Without CONFIG_SPINLOCK, rspin_restorelock() expands to nothing, so a
    caller that keeps the value of rspin_breaklock() only to pass it back
    gets -Wunused-but-set-variable. Evaluate the count in the stub.
    
    Signed-off-by: Bowen Wang <[email protected]>
---
 include/nuttx/spinlock.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/nuttx/spinlock.h b/include/nuttx/spinlock.h
index 44cd6efbb56..7b4d5f4c0bb 100644
--- a/include/nuttx/spinlock.h
+++ b/include/nuttx/spinlock.h
@@ -1239,7 +1239,7 @@ void rspin_restorelock(FAR rspinlock_t *lock, uint16_t 
count)
 }
 #else
 #  define rspin_breaklock(lock) (0)
-#  define rspin_restorelock(lock, count)
+#  define rspin_restorelock(lock, count) ((void)(count))
 #endif
 
 #ifdef CONFIG_RW_SPINLOCK

Reply via email to