Commit 8124d064 authored by frei tycho's avatar frei tycho Committed by Johan Hedberg
Browse files

include: zephyr: coding guidelines: add explicit cast to void

- added explicit cast to void when returned value is expectedly ignored

Signed-off-by: default avatarfrei tycho <tfrei@baumer.com>
parent 0a5e7f85
Loading
Loading
Loading
Loading
+4 −4
Changes for include/zephyr/spinlock.h: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -316,7 +316,7 @@ static ALWAYS_INLINE void k_spin_unlock(struct k_spinlock *l,
#ifdef CONFIG_SMP
#ifdef CONFIG_TICKET_SPINLOCKS
	/* Give the spinlock to the next CPU in a FIFO */
	atomic_inc(&l->owner);
	(void)atomic_inc(&l->owner);
#else
	/* Strictly we don't need atomic_clear() here (which is an
	 * exchange operation that returns the old value).  We are always
@@ -325,7 +325,7 @@ static ALWAYS_INLINE void k_spin_unlock(struct k_spinlock *l,
	 * a memory barrier when used like this, and we don't have a
	 * Zephyr framework for that.
	 */
	atomic_clear(&l->locked);
	(void)atomic_clear(&l->locked);
#endif /* CONFIG_TICKET_SPINLOCKS */
#endif /* CONFIG_SMP */
	arch_irq_unlock(key.key);
@@ -364,9 +364,9 @@ static ALWAYS_INLINE void k_spin_release(struct k_spinlock *l)
#endif
#ifdef CONFIG_SMP
#ifdef CONFIG_TICKET_SPINLOCKS
	atomic_inc(&l->owner);
	(void)atomic_inc(&l->owner);
#else
	atomic_clear(&l->locked);
	(void)atomic_clear(&l->locked);
#endif /* CONFIG_TICKET_SPINLOCKS */
#endif /* CONFIG_SMP */
}