Skip to contentSkip to conversation

remove redundant ACCESS_ONCE definition from rcupreempt.c

PATCH Applied Paul E. McKenney 2 participants 2 messages Aug 17, 2008 – Aug 18, 2008 Sparse checker

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remove redundant ACCESS_ONCE definition from rcupreempt.c

Remove the redundant definition of ACCESS_ONCE() from rcupreempt.c in favor of the one in compiler.h. Also merge the comment header from rcupreempt.c's definition into that in compiler.h.

---

 include/linux/compiler.h |    4 +++-
 kernel/rcupreempt.c      |    8 --------
 2 files changed, 3 insertions(+), 9 deletions(-)
include/linux/compiler.h +3 -1
index c8bd2da..8322141 100644
@@ -190,7 +190,9 @@ extern void __chk_io_ptr(const volatile void __iomem *);
  * ACCESS_ONCE() in different C statements.
  *
  * This macro does absolutely -nothing- to prevent the CPU from reordering,
- * merging, or refetching absolutely anything at any time.
+ * merging, or refetching absolutely anything at any time.  Its main intended
+ * use is to mediate communication between process-level code and irq/NMI
+ * handlers, all running on the same CPU.
  */
 #define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
 
kernel/rcupreempt.c +0 -8
index 2782793..ca4bbbe 100644
@@ -59,14 +59,6 @@
 #include <linux/rcupreempt_trace.h>
 
 /*
- * Macro that prevents the compiler from reordering accesses, but does
- * absolutely -nothing- to prevent CPUs from reordering.  This is used
- * only to mediate communication between mainline code and hardware
- * interrupt and NMI handlers.
- */
-#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
-
-/*
  * PREEMPT_RCU data structures.
  */
 
Applied
#1 lore raw
Quoted 3 lines · Paul E. McKenney

Remove the redundant definition of ACCESS_ONCE() from rcupreempt.c in favor of the one in compiler.h. Also merge the comment header from rcupreempt.c's definition into that in compiler.h.

applied to tip/core/rcu, thanks Paul!

Ingo