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: <pnvzk66ota2ebjnhjcfqhqsqepevl3f5khllqg7jd77zq562on@cm2rh72mvbzz>
Date: Thu, 1 May 2025 22:55:09 +0200
From: Sebastian Reichel <sre@...nel.org>
To: Oleksij Rempel <o.rempel@...gutronix.de>
Cc: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>, 
	Benson Leung <bleung@...omium.org>, Tzung-Bi Shih <tzungbi@...nel.org>, 
	Daniel Lezcano <daniel.lezcano@...aro.org>, Matti Vaittinen <mazziesaccount@...il.com>, 
	Mark Brown <broonie@...nel.org>, kernel@...gutronix.de, linux-kernel@...r.kernel.org, 
	Liam Girdwood <lgirdwood@...il.com>, "Rafael J. Wysocki" <rafael@...nel.org>, 
	Zhang Rui <rui.zhang@...el.com>, Lukasz Luba <lukasz.luba@....com>, linux-pm@...r.kernel.org, 
	Søren Andersen <san@...v.dk>, Guenter Roeck <groeck@...omium.org>, 
	Ahmad Fatoum <a.fatoum@...gutronix.de>, Andrew Morton <akpm@...ux-foundation.org>, 
	chrome-platform@...ts.linux.dev
Subject: Re: [PATCH v9 2/7] reboot: hw_protection_trigger: use standardized
 numeric shutdown/reboot reasons instead of strings

Hi,

On Tue, Apr 22, 2025 at 10:57:12AM +0200, Oleksij Rempel wrote:
> diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
> index 90629a756693..84448a4c7fd4 100644
> --- a/drivers/regulator/core.c
> +++ b/drivers/regulator/core.c
> @@ -5263,26 +5263,23 @@ EXPORT_SYMBOL_GPL(regulator_bulk_free);
>  static void regulator_handle_critical(struct regulator_dev *rdev,
>  				      unsigned long event)
>  {
> -	const char *reason = NULL;
> +	enum psc_reason pscr;

enum psc_reason pscr = PSCR_UNKNOWN;

(or add a default clause to the switch)

>  	if (!rdev->constraints->system_critical)
>  		return;
>  
>  	switch (event) {
>  	case REGULATOR_EVENT_UNDER_VOLTAGE:
> -		reason = "System critical regulator: voltage drop detected";
> +		pscr = PSCR_UNDER_VOLTAGE;
>  		break;
>  	case REGULATOR_EVENT_OVER_CURRENT:
> -		reason = "System critical regulator: over-current detected";
> +		pscr = PSCR_OVER_CURRENT;
>  		break;
>  	case REGULATOR_EVENT_FAIL:
> -		reason = "System critical regulator: unknown error";
> +		pscr = PSCR_REGULATOR_FAILURE;
>  	}
>  
> -	if (!reason)
> -		return;
> -
> -	hw_protection_trigger(reason,
> +	hw_protection_trigger(pscr,
>  			      rdev->constraints->uv_less_critical_window_ms);
>  }

Greetings,

-- Sebastian

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ