[PATCH] Documentation/memory-barriers: polish compiler store omit example
From: SeongJae Park
Date: Mon Feb 22 2016 - 05:26:18 EST
Comments of examples about compiler store omit in memory-barriers.txt is
about code that could be possible at that point. However, someone could
interpret the comment as an explanation about below line. This commit
exploits the intent more explicitly by changing the comment to be seems
like a possible code rather than explanation about below line.
Signed-off-by: SeongJae Park <sj38.park@xxxxxxxxx>
---
Documentation/memory-barriers.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/memory-barriers.txt
b/Documentation/memory-barriers.txt
index 904ee42..dc66351 100644
--- a/Documentation/memory-barriers.txt
+++ b/Documentation/memory-barriers.txt
@@ -1459,7 +1459,7 @@ of optimizations:
the following:
a = 0;
- /* Code that does not store to variable a. */
+ ... Code that does not store to variable a ...
a = 0;
The compiler sees that the value of variable 'a' is already zero, so
@@ -1471,7 +1471,7 @@ of optimizations:
wrong guess:
WRITE_ONCE(a, 0);
- /* Code that does not store to variable a. */
+ ... Code that does not store to variable a ...
WRITE_ONCE(a, 0);
(*) The compiler is within its rights to reorder memory accesses unless
--
1.9.1
>
> David
>