mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Wan Jiabing <wanjiabing@vivo.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org
Cc: kael_w@yeah.net
Subject: Re: [PATCH] ring-buffer: simplify if-if to if-else
Date: Sun, 24 Apr 2022 09:12:45 -0700	[thread overview]
Message-ID: <71297b444533a2348b8cb211674453bf65848f82.camel@perches.com> (raw)
In-Reply-To: <20220424093442.102230-1-wanjiabing@vivo.com>

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;



  reply	other threads:[~2022-04-24 16:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-24  9:34 Wan Jiabing
2022-04-24 16:12 ` Joe Perches [this message]
2022-04-25 15:24   ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=71297b444533a2348b8cb211674453bf65848f82.camel@perches.com \
    --to=joe@perches.com \
    --cc=kael_w@yeah.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=wanjiabing@vivo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®