Re: [PATCH v4] Added warnings in checkpatch.pl script to :
From: Jonathan Corbet
Date: Tue Jul 09 2019 - 11:58:12 EST
On Tue, 9 Jul 2019 21:18:06 +0530
NitinGote <nitin.r.gote@xxxxxxxxx> wrote:
> From: Nitin Gote <nitin.r.gote@xxxxxxxxx>
>
> 1. Deprecate strcpy() in favor of strscpy().
> 2. Deprecate strlcpy() in favor of strscpy().
> 3. Deprecate strncpy() in favor of strscpy() or strscpy_pad().
>
> Updated strncpy() section in Documentation/process/deprecated.rst
> to cover strscpy_pad() case.
>
> Signed-off-by: Nitin Gote <nitin.r.gote@xxxxxxxxx>
> ---
> Change log:
> v1->v2
> - For string related apis, created different %deprecated_string_api
> and these will get emitted at CHECK Level using command line option
> -f/--file to avoid bad patched from novice script users.
>
> v2->v3
> - Avoided use of $check in implementation.
> - Incorporated trivial comments.
>
> v3->v4
> - Incorporated comment by removing "c:func:"
But you ignored the comment asking for a proper subject line on the
patch.
Also,
> -only NUL-terminated strings. The safe replacement is :c:func:`strscpy`.
> -(Users of :c:func:`strscpy` still needing NUL-padding will need an
> -explicit :c:func:`memset` added.)
> +only NUL-terminated strings. In this case, the safe replacement is
> +`strscpy()`. If, however, the destination buffer still needs NUL-padding,
> +the safe replacement is `strscpy_pad()`.
Please make those just strscpy(), not `strscpy()`. As I said, the right
thing will happen.
Thanks,
jon