From: SeongJae Park <sj@kernel.org>
To: paulmck@kernel.org
Cc: SeongJae Park <sj38.park@gmail.com>, perfbook@vger.kernel.org
Subject: [PATCH 05/10] memorder: Remove braces for single line if-else blocks
Date: Sat, 23 Sep 2023 09:31:59 -0700 [thread overview]
Message-ID: <20230923163204.14558-6-sj@kernel.org> (raw)
In-Reply-To: <20230923163204.14558-1-sj@kernel.org>
From: SeongJae Park <sj38.park@gmail.com>
Code snippets in memorder.tex usually don't use braces for signle-line
if blocks, like Linux kernel coding style. However, some code snippets
use braces. Don't use the braces to be consistent.
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
---
memorder/memorder.tex | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/memorder/memorder.tex b/memorder/memorder.tex
index 5ad7e796..b5887764 100644
--- a/memorder/memorder.tex
+++ b/memorder/memorder.tex
@@ -3896,11 +3896,10 @@ optimization levels:
q = READ_ONCE(x);
barrier();
WRITE_ONCE(y, 1); /* BUG: No ordering!!! */
-if (q) {
+if (q)
do_something();
-} else {
+else
do_something_else();
-}
\end{VerbatimN}
Now there is no conditional between the load from~\co{x} and the store
@@ -4005,11 +4004,10 @@ not necessarily apply to code following the if-statement:
\begin{VerbatimN}
q = READ_ONCE(x);
-if (q) {
+if (q)
WRITE_ONCE(y, 1);
-} else {
+else
WRITE_ONCE(y, 2);
-}
WRITE_ONCE(z, 1); /* BUG: No ordering. */
\end{VerbatimN}
--
2.17.1
next prev parent reply other threads:[~2023-09-23 16:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-23 16:31 [PATCH 00/10] memorder: Trivial fixups SeongJae Park
2023-09-23 16:31 ` [PATCH 01/10] memorder: Fix typos: s/,/./ SeongJae Park
2023-09-23 16:31 ` [PATCH 02/10] memorder/memorder: Add a missing space between column name and 'column' SeongJae Park
2023-09-23 16:31 ` [PATCH 03/10] memorder: Add missing unbreakable spaces between 'values', 'and', and numbers SeongJae Park
2023-09-23 16:31 ` [PATCH 04/10] memorder: Remove an empty fcvref block SeongJae Park
2023-09-23 16:31 ` SeongJae Park [this message]
2023-09-23 16:32 ` [PATCH 06/10] memorder: Consistently use \co{} instead of {\tt } for code SeongJae Park
2023-09-23 16:32 ` [PATCH 07/10] memorder: Consistently use '\co{}' for 'herd' SeongJae Park
2023-09-23 16:32 ` [PATCH 08/10] memorder: Remove a redundant sentence for memory barrier strength SeongJae Park
2023-09-23 16:32 ` [PATCH 09/10] memorder: Make clear the scope of READ_ONCE()/WRITE_ONCE() heavy uses SeongJae Park
2023-09-23 16:32 ` [PATCH 10/10] memorder: Fix wrong primitive names in a quick quizz SeongJae Park
2023-09-24 0:02 ` Akira Yokosawa
2023-09-24 15:40 ` SeongJae Park
2023-09-24 14:57 ` [PATCH 00/10] memorder: Trivial fixups 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=20230923163204.14558-6-sj@kernel.org \
--to=sj@kernel.org \
--cc=paulmck@kernel.org \
--cc=perfbook@vger.kernel.org \
--cc=sj38.park@gmail.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