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
