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: <84o6qsjduw.fsf@jogness.linutronix.de>
Date: Tue, 30 Sep 2025 15:05:03 +0206
From: John Ogness <john.ogness@...utronix.de>
To: Andrew Murray <amurray@...goodpenguin.co.uk>, Petr Mladek
 <pmladek@...e.com>, Steven Rostedt <rostedt@...dmis.org>, Sergey
 Senozhatsky <senozhatsky@...omium.org>
Cc: linux-kernel@...r.kernel.org, Andrew Murray <amurray@...goodpenguin.co.uk>
Subject: Re: [PATCH v2 2/3] printk: console_flush_one_record() code cleanup

On 2025-09-27, Andrew Murray <amurray@...goodpenguin.co.uk> wrote:
> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> index 060d4919de320fe21fd7aca73ba497e27c4ff334..e2c1cacdb4164489c60fe38f1e2837eb838107d6 100644
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -3193,6 +3194,7 @@ static bool console_flush_one_record(bool do_cond_resched, u64 *next_seq, bool *
>  	bool any_progress;
>  	int cookie;
>  
> +	*any_usable = false;

Since it is expected that @next_seq and @handover are initialized by
their callers (if their callers are interested in the values), then I
would expect @any_usable to be initialized by the
caller. console_flush_one_record() never reads this variable.

> @@ -3280,21 +3284,16 @@ static bool console_flush_one_record(bool do_cond_resched, u64 *next_seq, bool *
>   */
>  static bool console_flush_all(bool do_cond_resched, u64 *next_seq, bool *handover)
>  {
> -	bool any_usable = false;
> +	bool any_usable;

Since console_flush_all() does read @any_usable, I would expect it to
initialize @any_usable. So I would not remove this definition initialization.

>  	bool any_progress;
>  
>  	*next_seq = 0;
>  	*handover = false;
>  
>  	do {
> -		any_progress = console_flush_one_record(do_cond_resched, next_seq, handover,
> -							&any_usable);
> +		any_progress = console_flush_one_record(do_cond_resched, next_seq,
> +							handover, &any_usable);
>  

Since the second line of the call to console_flush_one_record() already
has a ton of whitespace, I would remove the above blank line.

John

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ