lkml.org 
[lkml]   [2022]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] ring-buffer: simplify if-if to if-else
From
Date
On Sun, 2022-04-24 at 17:34 +0800, Wan Jiabing wrote:
> Use if and else instead of if(A) and if (!A).
[]
> diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
[]
> @@ -6014,7 +6014,7 @@ static __init int test_ringbuffer(void)
> 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) {
> + else {

please run your proposed patches through checkpatch.

(add braces to the if block)

additionally:

the pr_info on two lines seems pointless and it's probably nicer
just written on a single line.

pr_info(" With dropped events, recorded len and size may not match alloced and written from above\n");

> if (RB_WARN_ON(buffer, total_len != total_alloc ||
> total_size != total_written))
> break;


\
 
 \ /
  Last update: 2022-04-24 18:15    [W:0.053 / U:4.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site