summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAkira Yokosawa <akiyks@gmail.com>2024-01-11 23:04:28 +0900
committerPaul E. McKenney <paulmck@kernel.org>2024-01-20 12:40:11 -0800
commit322a6ddba7dae4b627c4bfe313190621a40cd2db (patch)
tree47a12ae7c3666563e016430fd10affc9ec710160
parent4908618e83244f1ce65c3f26669a35a2d7b62391 (diff)
downloadperfbook-322a6ddba7dae4b627c4bfe313190621a40cd2db.tar.gz
count_lim_atomic.c: Enclose complex loop with {}
Let's get consistent with coding style of Linux kernel. Signed-off-by: Akira Yokosawa <akiyks@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
-rw-r--r--CodeSamples/count/count_lim_atomic.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/CodeSamples/count/count_lim_atomic.c b/CodeSamples/count/count_lim_atomic.c
index 8c4dcc75..27c4b38e 100644
--- a/CodeSamples/count/count_lim_atomic.c
+++ b/CodeSamples/count/count_lim_atomic.c
@@ -84,13 +84,14 @@ static void flush_local_count(void) //\lnlbl{flush:b}
if (globalreserve == 0) //\lnlbl{flush:checkrsv}
return; //\lnlbl{flush:return:n}
zero = merge_counterandmax(0, 0); //\lnlbl{flush:initzero}
- for_each_thread(t) //\lnlbl{flush:loop:b}
+ for_each_thread(t) { //\lnlbl{flush:loop:b}
if (counterp[t] != NULL) { //\lnlbl{flush:checkp}
old = atomic_xchg(counterp[t], zero);//\lnlbl{flush:atmxchg}
split_counterandmax_int(old, &c, &cm);//\lnlbl{flush:split}
globalcount += c; //\lnlbl{flush:glbcnt}
globalreserve -= cm; //\lnlbl{flush:glbrsv}
- } //\lnlbl{flush:loop:e}
+ }
+ } //\lnlbl{flush:loop:e}
} //\lnlbl{flush:e}
//\end{snippet}