Olaf Hering
2012-Jan-30 12:12 UTC
[PATCH] tools/libxc: remove volatile keyword for bitmap operations
# HG changeset patch # User Olaf Hering <olaf@aepfle.de> # Date 1327925537 -3600 # Node ID 686f053d460da35f26b42b74e2ef41b6aceb5711 # Parent 4374739bd1428aead1c7f49beac6a28031c8d20b tools/libxc: remove volatile keyword for bitmap operations All bitmaps maintained by xc_bitops.h are used in single threaded applications. So nothing will change the bitmaps content, adding volatile adds just unneeded memory reloads. xenpaging uses bitmaps alot and using non-volatile versions will slightly improve performance. Signed-off-by: Olaf Hering <olaf@aepfle.de> diff -r 4374739bd142 -r 686f053d460d tools/libxc/xc_bitops.h --- a/tools/libxc/xc_bitops.h +++ b/tools/libxc/xc_bitops.h @@ -31,29 +31,29 @@ static inline void bitmap_clear(unsigned memset(addr, 0, bitmap_size(nr_bits)); } -static inline int test_bit(int nr, volatile unsigned long *addr) +static inline int test_bit(int nr, unsigned long *addr) { return (BITMAP_ENTRY(nr, addr) >> BITMAP_SHIFT(nr)) & 1; } -static inline void clear_bit(int nr, volatile unsigned long *addr) +static inline void clear_bit(int nr, unsigned long *addr) { BITMAP_ENTRY(nr, addr) &= ~(1UL << BITMAP_SHIFT(nr)); } -static inline void set_bit(int nr, volatile unsigned long *addr) +static inline void set_bit(int nr, unsigned long *addr) { BITMAP_ENTRY(nr, addr) |= (1UL << BITMAP_SHIFT(nr)); } -static inline int test_and_clear_bit(int nr, volatile unsigned long *addr) +static inline int test_and_clear_bit(int nr, unsigned long *addr) { int oldbit = test_bit(nr, addr); clear_bit(nr, addr); return oldbit; } -static inline int test_and_set_bit(int nr, volatile unsigned long *addr) +static inline int test_and_set_bit(int nr, unsigned long *addr) { int oldbit = test_bit(nr, addr); set_bit(nr, addr);