[PATCH -perfbook 1/2] count_lim_atomic.c: Enclose complex loop with {}

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Subject: [PATCH -perfbook 1/2] count_lim_atomic.c: Enclose complex loop with {}

Let's get consistent with coding style of Linux kernel.

Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx>
---
 CodeSamples/count/count_lim_atomic.c | 5 +++--
 1 file 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}
 
-- 
2.34.1






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux