[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <53007EE9-0DF2-4772-8254-0551F4093CE8@linux.dev>
Date: Tue, 19 Aug 2025 12:00:02 +0200
From: Thorsten Blum <thorsten.blum@...ux.dev>
To: Justin Stitt <justinstitt@...gle.com>
Cc: Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
linux-hardening@...r.kernel.org,
linux-mips@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/8] MIPS: arc: Replace deprecated strcpy() with memcpy()
Hi Justin,
On 19. Aug 2025, at 01:58, Justin Stitt wrote:
> On Sun, Aug 17, 2025 at 08:37:15PM +0200, Thorsten Blum wrote:
>> strcpy() is deprecated; use memcpy() instead.
>>
>> Use pr_debug() instead of printk(KERN_DEBUG) to silence a checkpatch
>> warning.
>
> I'd like to see more reasoning for why you chose memcpy() here. With api
> refactors like this I think most folks want to know if 1) there is any
> functional change and 2) why you chose the api.
1) No functional changes intended.
2) To advance the pointer 'cp', we already determine the string length
'len' using strlen(), which allows us to use memcpy() directly. This is
slightly more efficient than strscpy(), which would recompute the length
before calling memcpy() internally. We could also use strscpy() and its
return value as the length, but that would require checking for string
truncation, which might introduce a functional change.
Thanks,
Thorsten
Powered by blists - more mailing lists