[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <10eecd8c-52b8-4050-8b1d-f612f4ffc653@kernel.org>
Date: Mon, 17 Mar 2025 07:21:23 +0100
From: Jiri Slaby <jirislaby@...nel.org>
To: xie.ludan@....com.cn, xiubo.lee@...il.com
Cc: shengjiu.wang@...il.com, festevam@...il.com, nicoleotsuka@...il.com,
lgirdwood@...il.com, broonie@...nel.org, perex@...ex.cz, tiwai@...e.com,
shawnguo@...nel.org, s.hauer@...gutronix.de, kernel@...gutronix.de,
linux-sound@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
imx@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH linux-next] ASoC: use sysfs_emit() instead of scnprintf().
On 15. 03. 25, 7:15, xie.ludan@....com.cn wrote:
> From: XieLudan <xie.ludan@....com.cn>
>
>
> Follow the advice in Documentation/filesystems/sysfs.rst:
>
> show() should only use sysfs_emit() or sysfs_emit_at() when formatting
>
> the value to be returned to user space.
>
>
> Signed-off-by: XieLudan <xie.ludan@....com.cn>
>
> ---
>
> sound/soc/fsl/imx-audmux.c | 26 +++++++++++---------------
>
> 1 file changed, 11 insertions(+), 15 deletions(-)
>
>
> diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c
>
> index cc2918ee2cf5..6062503d3543 100644
>
> --- a/sound/soc/fsl/imx-audmux.c
>
> +++ b/sound/soc/fsl/imx-audmux.c
>
> @@ -77,45 +77,41 @@ static ssize_t audmux_read_file(struct file *file,
> char __user *user_buf,
>
> ret = sysfs_emit(buf, "PDCR: %08x\nPTCR: %08x\n", pdcr, ptcr);
>
> if (ptcr & IMX_AUDMUX_V2_PTCR_TFSDIR)
>
> -ret += scnprintf(buf + ret, PAGE_SIZE - ret,
>
> +ret += sysfs_emit(buf + ret,
This is wrong too [1].
[1]
https://lore.kernel.org/all/9c552d9a-2d46-4069-a9c4-35fab857bfc3@kernel.org/
regards,
--
js
suse labs
Powered by blists - more mailing lists