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: <Z4325IopvxTN_34R@google.com>
Date: Mon, 20 Jan 2025 07:10:28 +0000
From: Tzung-Bi Shih <tzungbi@...nel.org>
To: Ahmad Fatoum <a.fatoum@...gutronix.de>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
	Daniel Lezcano <daniel.lezcano@...aro.org>,
	Fabio Estevam <festevam@...x.de>,
	"Rafael J. Wysocki" <rafael@...nel.org>,
	Zhang Rui <rui.zhang@...el.com>, Lukasz Luba <lukasz.luba@....com>,
	Jonathan Corbet <corbet@....net>, Serge Hallyn <serge@...lyn.com>,
	Liam Girdwood <lgirdwood@...il.com>,
	Mark Brown <broonie@...nel.org>,
	Matti Vaittinen <mazziesaccount@...il.com>,
	Benson Leung <bleung@...omium.org>,
	Guenter Roeck <groeck@...omium.org>, Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>, linux-kernel@...r.kernel.org,
	linux-pm@...r.kernel.org, linux-doc@...r.kernel.org,
	linux-security-module@...r.kernel.org,
	chrome-platform@...ts.linux.dev, devicetree@...r.kernel.org,
	kernel@...gutronix.de
Subject: Re: [PATCH v2 01/12] reboot: replace __hw_protection_shutdown bool
 action parameter with an enum

On Mon, Jan 13, 2025 at 05:25:26PM +0100, Ahmad Fatoum wrote:
> Currently __hw_protection_shutdown() either reboots or shuts down the
> system according to its shutdown argument.
> 
> To make the logic easier to follow, both inside __hw_protection_shutdown
> and at caller sites, lets replace the bool parameter with an enum.
> 
> This will be extra useful, when in a later commit, a third action is
> added to the enumeration.
> 
> No functional change.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@...gutronix.de>

With a minor question,
Reviewed-by: Tzung-Bi Shih <tzungbi@...nel.org>

> @@ -1009,10 +1007,10 @@ void __hw_protection_shutdown(const char *reason, int ms_until_forced, bool shut
>  	 * orderly_poweroff failure
>  	 */
>  	hw_failure_emergency_poweroff(ms_until_forced);
> -	if (shutdown)
> -		orderly_poweroff(true);
> -	else
> +	if (action == HWPROT_ACT_REBOOT)
>  		orderly_reboot();
> +	else
> +		orderly_poweroff(true);

It probably doesn't really matter.  Does it intend to change the branch
order?  As s/shutdown/action == HWPROT_ACT_SHUTDOWN/ should be more
intuitive for the hunk to me.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ