Re: [PATCH] PM: wakeup: Delete space in the end of string shown by pm_show_wakelocks()
From: Rafael J. Wysocki
Date: Fri May 09 2025 - 09:53:13 EST
On Mon, May 5, 2025 at 11:27 AM Zijun Hu <zijun_hu@xxxxxxxxxx> wrote:
>
> From: Zijun Hu <quic_zijuhu@xxxxxxxxxxx>
>
> pm_show_wakelocks() is called to generate a string when showing attributes
> /sys/power/wake_(lock|unlock), but the string ends with an unwanted space
> the space was added back by mistake by commit c9d967b2ce40
> ("PM: wakeup: simplify the output logic of pm_show_wakelocks()").
>
> Remove the unwanted space.
>
> Signed-off-by: Zijun Hu <quic_zijuhu@xxxxxxxxxxx>
> ---
> kernel/power/wakelock.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/kernel/power/wakelock.c b/kernel/power/wakelock.c
> index 52571dcad768b988eaadbd3ce98a4ac42dd2f7dd..4e941999a53ba69410f4526d5d55c32312c36140 100644
> --- a/kernel/power/wakelock.c
> +++ b/kernel/power/wakelock.c
> @@ -49,6 +49,9 @@ ssize_t pm_show_wakelocks(char *buf, bool show_active)
> len += sysfs_emit_at(buf, len, "%s ", wl->name);
> }
>
> + if (len > 0)
> + --len;
> +
> len += sysfs_emit_at(buf, len, "\n");
>
> mutex_unlock(&wakelocks_lock);
>
> ---
Applied as 6.16 material, thanks!