All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ring-buffer: simplify if-if to if-else
@ 2022-04-25  3:01 Wan Jiabing
  0 siblings, 0 replies; only message in thread
From: Wan Jiabing @ 2022-04-25  3:01 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar, linux-kernel; +Cc: kael_w, joe, Wan Jiabing

Use if and else instead of if(A) and if (!A).

Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
---
Change log:
v2:
- add braces to the if block and make pr_info nicer.
---
 kernel/trace/ring_buffer.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 05dfc7a12d3d..2860db50413f 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -6011,10 +6011,9 @@ static __init int test_ringbuffer(void)
 		pr_info("        total events:   %ld\n", total_lost + total_read);
 		pr_info("  recorded len bytes:   %ld\n", total_len);
 		pr_info(" recorded size bytes:   %ld\n", total_size);
-		if (total_lost)
-			pr_info(" With dropped events, record len and size may not match\n"
-				" alloced and written from above\n");
-		if (!total_lost) {
+		if (total_lost) {
+			pr_info(" With dropped events, record len and size may not match alloced and written from above\n");
+		} else {
 			if (RB_WARN_ON(buffer, total_len != total_alloc ||
 				       total_size != total_written))
 				break;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-25  3:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-25  3:01 [PATCH v2] ring-buffer: simplify if-if to if-else Wan Jiabing

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.