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]
Date:   Fri, 20 Jan 2023 18:00:50 +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, srinivas.pandruvada@...ux.intel.com,
        dave@...olabs.net, chuansheng.liu@...el.com,
        joeyli.kernel@...il.com, jiasheng@...as.ac.cn,
        linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] thermal/int340x_thermal: Convert to use sysfs_emit_at() API

On Tue, Jan 17, 2023 at 3:42 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>
> ---
>  .../thermal/intel/int340x_thermal/int3400_thermal.c    | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> index db8a6f63657d..c1fc4a78607c 100644
> --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> @@ -130,10 +130,7 @@ static ssize_t available_uuids_show(struct device *dev,
>
>         for (i = 0; i < INT3400_THERMAL_MAXIMUM_UUID; i++) {
>                 if (priv->uuid_bitmap & (1 << i))
> -                       length += scnprintf(&buf[length],
> -                                           PAGE_SIZE - length,
> -                                           "%s\n",
> -                                           int3400_thermal_uuids[i]);
> +                       length += sysfs_emit_at(buf, length, int3400_thermal_uuids[i]);
>         }
>
>         return length;
> @@ -151,10 +148,7 @@ static ssize_t current_uuid_show(struct device *dev,
>
>         for (i = 0; i <= INT3400_THERMAL_CRITICAL; i++) {
>                 if (priv->os_uuid_mask & BIT(i))
> -                       length += scnprintf(&buf[length],
> -                                           PAGE_SIZE - length,
> -                                           "%s\n",
> -                                           int3400_thermal_uuids[i]);
> +                       length += sysfs_emit_at(buf, length, int3400_thermal_uuids[i]);
>         }
>
>         if (length)
> --

Applied as 6.3 material with a modified changelog, thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ