Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@kernel.org>
To: xie.ludan@zte.com.cn, xiubo.lee@gmail.com
Cc: shengjiu.wang@gmail.com, festevam@gmail.com,
	nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org,
	perex@perex.cz, tiwai@suse.com, shawnguo@kernel.org,
	s.hauer@pengutronix.de, kernel@pengutronix.de,
	linux-sound@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH linux-next] ASoC: use sysfs_emit() instead of scnprintf().
Date: Mon, 17 Mar 2025 07:21:23 +0100	[thread overview]
Message-ID: <10eecd8c-52b8-4050-8b1d-f612f4ffc653@kernel.org> (raw)
In-Reply-To: <20250315141546004ww7-8GUuuRfAQIb8b4KYZ@zte.com.cn>

On 15. 03. 25, 7:15, xie.ludan@zte.com.cn wrote:
> From: XieLudan <xie.ludan@zte.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@zte.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


  reply	other threads:[~2025-03-17  6:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-15  6:15 [PATCH linux-next] ASoC: use sysfs_emit() instead of scnprintf() xie.ludan
2025-03-17  6:21 ` Jiri Slaby [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-03-15  6:15 xie.ludan
2025-03-15  6:15 xie.ludan
2025-03-15  6:14 xie.ludan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10eecd8c-52b8-4050-8b1d-f612f4ffc653@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=broonie@kernel.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=nicoleotsuka@gmail.com \
    --cc=perex@perex.cz \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=shengjiu.wang@gmail.com \
    --cc=tiwai@suse.com \
    --cc=xie.ludan@zte.com.cn \
    --cc=xiubo.lee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox