lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <71297b444533a2348b8cb211674453bf65848f82.camel@perches.com>
Date:   Sun, 24 Apr 2022 09:12:45 -0700
From:   Joe Perches <joe@...ches.com>
To:     Wan Jiabing <wanjiabing@...o.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org
Cc:     kael_w@...h.net
Subject: Re: [PATCH] ring-buffer: simplify if-if to if-else

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;


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ