From: tip-bot for SeongJae Park <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hpa@zytor.com, tglx@linutronix.de, stern@rowland.harvard.edu,
sj38.park@gmail.com, will.deacon@arm.com,
akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
peterz@infradead.org, torvalds@linux-foundation.org,
mingo@kernel.org, paulmck@linux.vnet.ibm.com
Subject: [tip:locking/core] locking/Documentation: Fix incorrect example code
Date: Mon, 14 May 2018 23:24:52 -0700 [thread overview]
Message-ID: <tip-fc7bdc90249b216051d06496577c306327f2e3f5@git.kernel.org> (raw)
In-Reply-To: <1526338533-6044-7-git-send-email-paulmck@linux.vnet.ibm.com>
Commit-ID: fc7bdc90249b216051d06496577c306327f2e3f5
Gitweb: https://git.kernel.org/tip/fc7bdc90249b216051d06496577c306327f2e3f5
Author: SeongJae Park <sj38.park@gmail.com>
AuthorDate: Mon, 14 May 2018 15:55:32 -0700
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 15 May 2018 08:11:14 +0200
locking/Documentation: Fix incorrect example code
- Remove a stale line of code
- Fix the condition of the READ_ONCE() example
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Cc: akiyks@gmail.com
Cc: boqun.feng@gmail.com
Cc: dhowells@redhat.com
Cc: j.alglave@ucl.ac.uk
Cc: linux-arch@vger.kernel.org
Cc: luc.maranget@inria.fr
Cc: npiggin@gmail.com
Cc: parri.andrea@gmail.com
Link: http://lkml.kernel.org/r/1526338533-6044-7-git-send-email-paulmck@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
Documentation/core-api/atomic_ops.rst | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/Documentation/core-api/atomic_ops.rst b/Documentation/core-api/atomic_ops.rst
index fce929144ccd..4ea4af71e68a 100644
--- a/Documentation/core-api/atomic_ops.rst
+++ b/Documentation/core-api/atomic_ops.rst
@@ -111,7 +111,6 @@ If the compiler can prove that do_something() does not store to the
variable a, then the compiler is within its rights transforming this to
the following::
- tmp = a;
if (a > 0)
for (;;)
do_something();
@@ -119,7 +118,7 @@ the following::
If you don't want the compiler to do this (and you probably don't), then
you should use something like the following::
- while (READ_ONCE(a) < 0)
+ while (READ_ONCE(a) > 0)
do_something();
Alternatively, you could place a barrier() call in the loop.
next prev parent reply other threads:[~2018-05-15 6:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-14 22:54 [PATCH memory-model 0/8] memory-barriers.txt and atomic_ops.rst updates Paul E. McKenney
2018-05-14 22:55 ` [PATCH memory-model 1/8] docs/memory-barriers.txt: Fix broken DMA vs MMIO ordering example Paul E. McKenney
2018-05-15 6:21 ` [tip:locking/core] locking/memory-barriers.txt: Fix broken DMA vs. " tip-bot for Will Deacon
2018-05-14 22:55 ` [PATCH memory-model 2/8] kokr/doc: READ_ONCE() now implies smp_barrier_depends() Paul E. McKenney
2018-05-15 6:22 ` [tip:locking/core] locking/memory-barriers.txt/kokr: Update Korean translation to indicate that " tip-bot for SeongJae Park
2018-05-14 22:55 ` [PATCH memory-model 3/8] kokr/doc: De-emphasize smp_read_barrier_depends Paul E. McKenney
2018-05-15 6:22 ` [tip:locking/core] locking/memory-barriers.txt/kokr: Update Korean translation to de-emphasize smp_read_barrier_depends() tip-bot for SeongJae Park
2018-05-14 22:55 ` [PATCH memory-model 4/8] kokr/Documentation/memory-barriers.txt: Cross-reference "tools/memory-model/" Paul E. McKenney
2018-05-15 6:23 ` [tip:locking/core] locking/memory-barriers.txt/kokr: Update Korean translation to cross-reference "tools/memory-model/" tip-bot for SeongJae Park
2018-05-14 22:55 ` [PATCH memory-model 5/8] kokr/memory-barriers: Fix description of data dependency barriers Paul E. McKenney
2018-05-15 6:23 ` [tip:locking/core] locking/memory-barriers.txt/kokr: Update Korean translation to fix " tip-bot for SeongJae Park
2018-05-14 22:55 ` [PATCH memory-model 6/8] kokr/locking/memory-barriers: De-emphasize smp_read_barrier_depends() some more Paul E. McKenney
2018-05-15 6:24 ` [tip:locking/core] locking/memory-barriers.txt/kokr: Update Korean translation to de-emphasize " tip-bot for SeongJae Park
2018-05-14 22:55 ` [PATCH memory-model 7/8] atomic_ops.rst: Fix wrong example code Paul E. McKenney
2018-05-15 6:24 ` tip-bot for SeongJae Park [this message]
2018-05-14 22:55 ` [PATCH memory-model 8/8] atomic_ops.rst: Use `warning` rst directive Paul E. McKenney
2018-05-15 6:25 ` [tip:locking/core] locking/Documentation: Use `warning` RST directive tip-bot for SeongJae Park
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-fc7bdc90249b216051d06496577c306327f2e3f5@git.kernel.org \
--to=tipbot@zytor.com \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=sj38.park@gmail.com \
--cc=stern@rowland.harvard.edu \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=will.deacon@arm.com \
/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;
as well as URLs for NNTP newsgroup(s).