xchg is atomic with side-effects
authorPatrick Georgi <patrick@georgi-clan.de>
Sun, 11 Mar 2012 18:42:33 +0000 (19:42 +0100)
committerPatrick Georgi <patrick@georgi-clan.de>
Fri, 16 Mar 2012 21:22:49 +0000 (22:22 +0100)
clang doesn't know about the side effect, so we have to tell it
that it's okay not to care about the result.

Change-Id: Ib11890bff6779e36cf09c178d224695ea16a8ae8
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/783
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
src/include/cpu/x86/lapic.h

index 8b44a6cb662ff752d45677e66fdf3d99de7a63a0..68608edab1374e94d34a633bb274f94e1a4daf77 100644 (file)
@@ -108,7 +108,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
 
 static inline void lapic_write_atomic(unsigned long reg, unsigned long v)
 {
-       xchg((volatile unsigned long *)(LAPIC_DEFAULT_BASE+reg), v);
+       (void)xchg((volatile unsigned long *)(LAPIC_DEFAULT_BASE+reg), v);
 }