[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <242e67a0-0a07-458d-a3ed-e37062d940a3@kernel.org>
Date: Mon, 17 Mar 2025 07:28:05 +0100
From: Jiri Slaby <jirislaby@...nel.org>
To: xie.ludan@....com.cn, petr.pavlu@...e.com
Cc: linux@...ssschuh.net, mcgrof@...nel.org, thorsten.blum@...ux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH linux-next] params: use sysfs_emit() instead of
scnprintf().
On 15. 03. 25, 7:17, 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>
>
> ---
>
> 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
Powered by blists - more mailing lists