[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YwNtYw3zwGTGvMlO@li-4a3a4a4c-28e5-11b2-a85c-a8d192c6f089.ibm.com>
Date: Mon, 22 Aug 2022 13:49:55 +0200
From: Alexander Gordeev <agordeev@...ux.ibm.com>
To: Wolfram Sang <wsa+renesas@...g-engineering.com>
Cc: linux-kernel@...r.kernel.org, Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Sven Schnelle <svens@...ux.ibm.com>, linux-s390@...r.kernel.org
Subject: Re: [PATCH] s390: move from strlcpy with unused retval to strscpy
On Thu, Aug 18, 2022 at 10:59:47PM +0200, Wolfram Sang wrote:
> Follow the advice of the below link and prefer 'strscpy' in this
> subsystem. Conversion is 1:1 because the return value is not used.
> Generated by a coccinelle script.
>
> Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/
> Signed-off-by: Wolfram Sang <wsa+renesas@...g-engineering.com>
> ---
> arch/s390/kernel/debug.c | 2 +-
> arch/s390/kernel/early.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
> index 4331c7e6e1c0..d7a82066a638 100644
> --- a/arch/s390/kernel/debug.c
> +++ b/arch/s390/kernel/debug.c
> @@ -250,7 +250,7 @@ static debug_info_t *debug_info_alloc(const char *name, int pages_per_area,
> rc->level = level;
> rc->buf_size = buf_size;
> rc->entry_size = sizeof(debug_entry_t) + buf_size;
> - strlcpy(rc->name, name, sizeof(rc->name));
> + strscpy(rc->name, name, sizeof(rc->name));
> memset(rc->views, 0, DEBUG_MAX_VIEWS * sizeof(struct debug_view *));
> memset(rc->debugfs_entries, 0, DEBUG_MAX_VIEWS * sizeof(struct dentry *));
> refcount_set(&(rc->ref_count), 0);
> diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
> index 432c8c987256..6030fdd6997b 100644
> --- a/arch/s390/kernel/early.c
> +++ b/arch/s390/kernel/early.c
> @@ -267,7 +267,7 @@ char __bootdata(early_command_line)[COMMAND_LINE_SIZE];
> static void __init setup_boot_command_line(void)
> {
> /* copy arch command line */
> - strlcpy(boot_command_line, early_command_line, COMMAND_LINE_SIZE);
> + strscpy(boot_command_line, early_command_line, COMMAND_LINE_SIZE);
> }
>
> static void __init check_image_bootable(void)
Acked-by: Alexander Gordeev <agordeev@...ux.ibm.com>
Powered by blists - more mailing lists