From 71f7f7546c2fa7f0950c76e8a687101dabe506eb Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Fri, 16 Aug 2013 19:31:57 +0400 Subject: [PATCH] atomic: Use atomic_read instead of atomic_get To switch to kernel's style. Signed-off-by: Cyrill Gorcunov Signed-off-by: Pavel Emelyanov --- arch/x86/include/asm/atomic.h | 5 ----- include/lock.h | 6 +++--- stats.c | 4 ++-- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/arch/x86/include/asm/atomic.h b/arch/x86/include/asm/atomic.h index 13f98502b..d4f7aafda 100644 --- a/arch/x86/include/asm/atomic.h +++ b/arch/x86/include/asm/atomic.h @@ -16,11 +16,6 @@ static inline int atomic_read(const atomic_t *v) return (*(volatile int *)&(v)->counter); } -/* - * FIXME Use atomic_read instead of atomic_get all over the code - */ -#define atomic_get atomic_read - static inline void atomic_set(atomic_t *v, int i) { v->counter = i; diff --git a/include/lock.h b/include/lock.h index fbf7d2b5b..89d71b1aa 100644 --- a/include/lock.h +++ b/include/lock.h @@ -21,7 +21,7 @@ typedef struct { /* Get current futex @f value */ static inline u32 futex_get(futex_t *f) { - return atomic_get(&f->raw); + return atomic_read(&f->raw); } /* Set futex @f value to @v */ @@ -39,7 +39,7 @@ static inline void futex_set(futex_t *f, u32 v) u32 tmp; \ \ while (1) { \ - tmp = (u32)atomic_get(&(__f)->raw); \ + tmp = (u32)atomic_read(&(__f)->raw); \ if ((tmp & FUTEX_ABORT_FLAG) || \ (tmp __cond (__v))) \ break; \ @@ -102,7 +102,7 @@ static inline void futex_wait_while_eq(futex_t *f, u32 v) /* Wait while futex @f value is @v */ static inline void futex_wait_while(futex_t *f, u32 v) { - while ((u32)atomic_get(&f->raw) == v) { + while ((u32)atomic_read(&f->raw) == v) { int ret = sys_futex((u32 *)&f->raw.counter, FUTEX_WAIT, v, NULL, NULL, 0); BUG_ON(ret < 0 && ret != -EWOULDBLOCK); } diff --git a/stats.c b/stats.c index 7e9f9fc91..04cd2c141 100644 --- a/stats.c +++ b/stats.c @@ -128,8 +128,8 @@ void write_stats(int what) } else if (what == RESTORE_STATS) { stats.restore = &rs_entry; - rs_entry.pages_compared = atomic_get(&rstats->counts[CNT_PAGES_COMPARED]); - rs_entry.pages_skipped_cow = atomic_get(&rstats->counts[CNT_PAGES_SKIPPED_COW]); + rs_entry.pages_compared = atomic_read(&rstats->counts[CNT_PAGES_COMPARED]); + rs_entry.pages_skipped_cow = atomic_read(&rstats->counts[CNT_PAGES_SKIPPED_COW]); encode_time(TIME_FORK, &rs_entry.forking_time); encode_time(TIME_RESTORE, &rs_entry.restore_time);