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] [day] [month] [year] [list]
Message-ID: <CAJZ5v0j2R0BW+Z9zZSW__7SxSDMuCikk5DUnDfp+VvOQdhjCuw@mail.gmail.com>
Date:   Thu, 9 Feb 2023 20:42:16 +0100
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     ye.xingchen@....com.cn
Cc:     rafael@...nel.org, daniel.lezcano@...aro.org, amitk@...nel.org,
        rui.zhang@...el.com, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] thermal: Convert to use sysfs_emit_at() API

On Tue, Jan 17, 2023 at 3:40 AM <ye.xingchen@....com.cn> wrote:
>
> From: ye xingchen <ye.xingchen@....com.cn>
>
> Follow the advice of the Documentation/filesystems/sysfs.rst and show()
> should only use sysfs_emit() or sysfs_emit_at() when formatting the
> value to be returned to user space.
>
> Signed-off-by: ye xingchen <ye.xingchen@....com.cn>
> ---
>  drivers/thermal/thermal_core.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index d9a3d9566d73..5ffc7006cce4 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -229,10 +229,9 @@ int thermal_build_list_of_policies(char *buf)
>         mutex_lock(&thermal_governor_lock);
>
>         list_for_each_entry(pos, &thermal_governor_list, governor_list) {
> -               count += scnprintf(buf + count, PAGE_SIZE - count, "%s ",
> -                                  pos->name);
> +               count += sysfs_emit_at(buf, count, "%s ", pos->name);
>         }
> -       count += scnprintf(buf + count, PAGE_SIZE - count, "\n");
> +       count += sysfs_emit_at(buf, count, "\n");
>
>         mutex_unlock(&thermal_governor_lock);
>
> --

Applied as 6.3 material, thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ