public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Mark Rutland <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: joe@perches.com, mingo@kernel.org, acme@redhat.com,
	mark.rutland@arm.com, peterz@infradead.org,
	paulmck@linux.vnet.ibm.com, tglx@linutronix.de,
	linux-kernel@vger.kernel.org, hpa@zytor.com,
	torvalds@linux-foundation.org
Subject: [tip:locking/urgent] tools/include: Remove ACCESS_ONCE()
Date: Tue, 12 Dec 2017 07:07:05 -0800	[thread overview]
Message-ID: <tip-2a22f692bbe0a7933acbd50045479ffc0fdf11f7@git.kernel.org> (raw)
In-Reply-To: <20171127103824.36526-3-mark.rutland@arm.com>

Commit-ID:  2a22f692bbe0a7933acbd50045479ffc0fdf11f7
Gitweb:     https://git.kernel.org/tip/2a22f692bbe0a7933acbd50045479ffc0fdf11f7
Author:     Mark Rutland <mark.rutland@arm.com>
AuthorDate: Mon, 27 Nov 2017 10:38:22 +0000
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 12 Dec 2017 13:22:10 +0100

tools/include: Remove ACCESS_ONCE()

There are no longer any usersapce uses of ACCESS_ONCE(), so we can
remove the definition from our userspace <linux/compiler.h>, which is
only used by tools in the kernel directory (i.e. it isn't a uapi
header).

This patch removes the ACCESS_ONCE() definition, and updates comments
which referred to it. At the same time, some inconsistent and redundant
whitespace is removed from comments.

Tested-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Joe Perches <joe@perches.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: apw@canonical.com
Link: http://lkml.kernel.org/r/20171127103824.36526-3-mark.rutland@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 tools/include/linux/compiler.h | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/tools/include/linux/compiler.h b/tools/include/linux/compiler.h
index 07fd03c..04e32f9 100644
--- a/tools/include/linux/compiler.h
+++ b/tools/include/linux/compiler.h
@@ -84,8 +84,6 @@
 
 #define uninitialized_var(x) x = *(&(x))
 
-#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
-
 #include <linux/types.h>
 
 /*
@@ -135,20 +133,19 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
 /*
  * Prevent the compiler from merging or refetching reads or writes. The
  * compiler is also forbidden from reordering successive instances of
- * READ_ONCE, WRITE_ONCE and ACCESS_ONCE (see below), but only when the
- * compiler is aware of some particular ordering.  One way to make the
- * compiler aware of ordering is to put the two invocations of READ_ONCE,
- * WRITE_ONCE or ACCESS_ONCE() in different C statements.
+ * READ_ONCE and WRITE_ONCE, but only when the compiler is aware of some
+ * particular ordering. One way to make the compiler aware of ordering is to
+ * put the two invocations of READ_ONCE or WRITE_ONCE in different C
+ * statements.
  *
- * In contrast to ACCESS_ONCE these two macros will also work on aggregate
- * data types like structs or unions. If the size of the accessed data
- * type exceeds the word size of the machine (e.g., 32 bits or 64 bits)
- * READ_ONCE() and WRITE_ONCE()  will fall back to memcpy and print a
- * compile-time warning.
+ * These two macros will also work on aggregate data types like structs or
+ * unions. If the size of the accessed data type exceeds the word size of
+ * the machine (e.g., 32 bits or 64 bits) READ_ONCE() and WRITE_ONCE() will
+ * fall back to memcpy and print a compile-time warning.
  *
  * Their two major use cases are: (1) Mediating communication between
  * process-level code and irq/NMI handlers, all running on the same CPU,
- * and (2) Ensuring that the compiler does not  fold, spindle, or otherwise
+ * and (2) Ensuring that the compiler does not fold, spindle, or otherwise
  * mutilate accesses that either do not require ordering or that interact
  * with an explicit memory barrier or atomic instruction that provides the
  * required ordering.

  reply	other threads:[~2017-12-12 15:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27 10:38 [PATCH 0/4] Final ACCESS_ONCE() cleanups for v4.15 Mark Rutland
2017-11-27 10:38 ` [PATCH 1/4] perf mmap: Convert ACCESS_ONCE() to READ_ONCE() Mark Rutland
2017-12-12 15:06   ` [tip:locking/urgent] tools/perf: " tip-bot for Mark Rutland
2017-11-27 10:38 ` [PATCH 2/4] tools: include: remove ACCESS_ONCE() Mark Rutland
2017-12-12 15:07   ` tip-bot for Mark Rutland [this message]
2017-11-27 10:38 ` [PATCH 3/4] compiler.h: " Mark Rutland
2017-12-12 15:07   ` [tip:locking/urgent] compiler.h: Remove ACCESS_ONCE() tip-bot for Mark Rutland
2017-11-27 10:38 ` [PATCH 4/4] checkpatch: remove ACCESS_ONCE() warning Mark Rutland
2017-11-27 10:50   ` Joe Perches
2017-11-27 10:58     ` Mark Rutland
2017-12-12 15:07   ` [tip:locking/urgent] checkpatch: Remove " tip-bot for Mark Rutland
2017-11-27 21:11 ` [PATCH 0/4] Final ACCESS_ONCE() cleanups for v4.15 Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-2a22f692bbe0a7933acbd50045479ffc0fdf11f7@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@redhat.com \
    --cc=hpa@zytor.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox