Re: [PATCH v15 3/6] reboot: add parsable tokens for power state change reasons
From: Daniel Lezcano
Date: Fri Oct 02 2026 - 03:58:19 EST
On Thu, Sep 24, 2026 at 12:38:44PM +0530, Faruque Ansari wrote:
> psc_reason_to_str() returns human-readable labels that contain spaces
> (e.g. "over temperature"). Those are fine for logs but unusable as
> values in a space-separated sysfs list or as a write target.
>
> Extend the single reason descriptor table with a stable, space-free
> token next to the existing label, and add psc_reason_to_token() and
> psc_reason_from_token() so consumers can emit and parse reasons without
> inventing their own string table.
>
> Co-developed-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
> Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
> Signed-off-by: Faruque Ansari <faruque.ansari@xxxxxxxxxxxxxxxx>
> Reviewed-by: Matti Vaittinen <mazziesaccount@xxxxxxxxx>
>
> Chnages v15
Nit: ^^^
> - Add Reviewed-by tags from Matti Vaittinen.
Reviewed-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxxxxxxxx>