public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@kernel.org>
To: xie.ludan@zte.com.cn, petr.pavlu@suse.com
Cc: linux@weissschuh.net, mcgrof@kernel.org, thorsten.blum@linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH linux-next] params: use sysfs_emit() instead of scnprintf().
Date: Mon, 17 Mar 2025 07:28:05 +0100	[thread overview]
Message-ID: <242e67a0-0a07-458d-a3ed-e37062d940a3@kernel.org> (raw)
In-Reply-To: <202503151417004728U9HCHFf6b_zP5GsZuMdu@zte.com.cn>

On 15. 03. 25, 7:17, 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>
> 
> ---
> 
>   kernel/params.c | 8 ++++----
> 
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> 
> diff --git a/kernel/params.c b/kernel/params.c
> 
> index 2509f216c9f3..89ae571af266 100644
> 
> --- a/kernel/params.c
> 
> +++ b/kernel/params.c
> 
> @@ -219,7 +219,7 @@ char *parse_args(const char *doing,
> 
> }\
> 
> int param_get_##name(char *buffer, const struct kernel_param *kp) \
> 
> {\
> 
> -return scnprintf(buffer, PAGE_SIZE, format "\n",\
> 
> +return sysfs_emit(buffer, format "\n",\

This has nothing to do with sysfs, right?

-- 
js
suse labs


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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-15  6:17 [PATCH linux-next] params: use sysfs_emit() instead of scnprintf() xie.ludan
2025-03-17  6:28 ` Jiri Slaby [this message]

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=242e67a0-0a07-458d-a3ed-e37062d940a3@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=mcgrof@kernel.org \
    --cc=petr.pavlu@suse.com \
    --cc=thorsten.blum@linux.dev \
    --cc=xie.ludan@zte.com.cn \
    /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