parlib/x86/atomic.h: (void) __sync_fetch_and_* calls
In several cases the return from __sync_fetch_and_* is ignored
and external builds were throwing errors when -Werror was used.
Indicate via the standard (void) cast that the
return from the call can be ignored.
Change-Id: I944cbaf25f5e7ecadf01d206fcc0c74935183780
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
diff --git a/user/parlib/include/parlib/x86/atomic.h b/user/parlib/include/parlib/x86/atomic.h
index da31c58..1ecd3e2 100644
--- a/user/parlib/include/parlib/x86/atomic.h
+++ b/user/parlib/include/parlib/x86/atomic.h
@@ -41,12 +41,12 @@
static inline void atomic_inc(atomic_t *number)
{
- __sync_fetch_and_add(number, 1);
+ (void)__sync_fetch_and_add(number, 1);
}
static inline void atomic_dec(atomic_t *number)
{
- __sync_fetch_and_sub(number, 1);
+ (void)__sync_fetch_and_sub(number, 1);
}
static inline long atomic_fetch_and_add(atomic_t *number, long val)
@@ -88,12 +88,12 @@
static inline void atomic_andb(volatile uint8_t *number, uint8_t mask)
{
- __sync_fetch_and_and(number, mask);
+ (void)__sync_fetch_and_and(number, mask);
}
static inline void atomic_orb(volatile uint8_t *number, uint8_t mask)
{
- __sync_fetch_and_or(number, mask);
+ (void)__sync_fetch_and_or(number, mask);
}
__END_DECLS