Re: [PATCH] kdb: Remove optional size arguments from strscpy() calls
From: Doug Anderson
Date: Thu Mar 20 2025 - 10:30:16 EST
Hi,
On Wed, Mar 19, 2025 at 9:35 AM Thorsten Blum <thorsten.blum@xxxxxxxxx> wrote:
>
> If the destination buffer has a fixed length, strscpy() automatically
> determines the size of the destination buffer using sizeof() if the
> argument is omitted. This makes the explicit sizeof() unnecessary.
>
> Furthermore, CMD_BUFLEN is equal to sizeof(kdb_prompt_str) and can also
> be removed. Remove them to shorten and simplify the code.
>
> No functional changes intended.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
> ---
> kernel/debug/kdb/kdb_io.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Douglas Anderson <dianders@xxxxxxxxxxxx>