Skip to content

Commit

Permalink
Remove (void)(l) for non-spinlock system
Browse files Browse the repository at this point in the history
(void)(l) is useless when CONFIG_SPINLOCK is disable.

Signed-off-by: TaiJu Wu <[email protected]>
  • Loading branch information
TaiJuWu committed Mar 15, 2024
1 parent ab6d74a commit 209d226
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/nuttx/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned int cpu,
#if defined(CONFIG_SMP) || defined(CONFIG_SPINLOCK)
irqstate_t spin_lock_irqsave(FAR spinlock_t *lock);
#else
# define spin_lock_irqsave(l) ((void)(l), up_irq_save())
# define spin_lock_irqsave(l) up_irq_save()
#endif

/****************************************************************************
Expand All @@ -456,7 +456,7 @@ irqstate_t spin_lock_irqsave(FAR spinlock_t *lock);
#if defined(CONFIG_SMP) || defined(CONFIG_SPINLOCK)
irqstate_t spin_lock_irqsave_wo_note(FAR spinlock_t *lock);
#else
# define spin_lock_irqsave_wo_note(l) ((void)(l), up_irq_save())
# define spin_lock_irqsave_wo_note(l) up_irq_save()
#endif

/****************************************************************************
Expand Down Expand Up @@ -702,7 +702,7 @@ void write_unlock(FAR volatile rwlock_t *lock);
#if defined(CONFIG_SMP) || defined(CONFIG_SPINLOCK)
irqstate_t read_lock_irqsave(FAR rwlock_t *lock);
#else
# define read_lock_irqsave(l) ((void)(l), up_irq_save())
# define read_lock_irqsave(l) up_irq_save()
#endif

/****************************************************************************
Expand Down Expand Up @@ -774,7 +774,7 @@ void read_unlock_irqrestore(FAR rwlock_t *lock, irqstate_t flags);
#if defined(CONFIG_SMP) || defined(CONFIG_SPINLOCK)
irqstate_t write_lock_irqsave(FAR rwlock_t *lock);
#else
# define write_lock_irqsave(l) ((void)(l), up_irq_save())
# define write_lock_irqsave(l) up_irq_save()
#endif

/****************************************************************************
Expand Down

0 comments on commit 209d226

Please sign in to comment.