checkpatches: suppress warning about strlcpy

Message ID 20210910175443.527801-1-stephen@networkplumber.org (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series checkpatches: suppress warning about strlcpy |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/github-robot: build success github build: passed
ci/iol-spell-check-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing fail Testing issues
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

Stephen Hemminger Sept. 10, 2021, 5:54 p.m. UTC
  Latest versions of Linux kernel checkpatch now complain about
uses of strlcpy (kernel perfers strcspy).

WARNING:STRLCPY: Prefer strscpy over strlcpy

But DPDK does not have strcspy so suppress the warning.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 devtools/checkpatches.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Bruce Richardson Sept. 13, 2021, 8:08 a.m. UTC | #1
On Fri, Sep 10, 2021 at 10:54:43AM -0700, Stephen Hemminger wrote:
> Latest versions of Linux kernel checkpatch now complain about
> uses of strlcpy (kernel perfers strcspy).
> 
> WARNING:STRLCPY: Prefer strscpy over strlcpy
> 
> But DPDK does not have strcspy so suppress the warning.
                           ^^^
typo :-)
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

We actually do have an rte_strscpy function, but on the other hand I
believe that strlcpy should very much also be acceptable.

Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  devtools/checkpatches.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
> index c314d83a29d3..057208c8e1ea 100755
> --- a/devtools/checkpatches.sh
> +++ b/devtools/checkpatches.sh
> @@ -33,7 +33,7 @@ VOLATILE,PREFER_PACKED,PREFER_ALIGNED,PREFER_PRINTF,\
>  PREFER_KERNEL_TYPES,PREFER_FALLTHROUGH,BIT_MACRO,CONST_STRUCT,\
>  SPLIT_STRING,LONG_LINE_STRING,C99_COMMENT_TOLERANCE,\
>  LINE_SPACING,PARENTHESIS_ALIGNMENT,NETWORKING_BLOCK_COMMENT_STYLE,\
> -NEW_TYPEDEFS,COMPARISON_TO_NULL"
> +NEW_TYPEDEFS,COMPARISON_TO_NULL,STRLCPY"
>  options="$options $DPDK_CHECKPATCH_OPTIONS"
>  
>  print_usage () {
> -- 
> 2.30.2
>
  

Patch

diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index c314d83a29d3..057208c8e1ea 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -33,7 +33,7 @@  VOLATILE,PREFER_PACKED,PREFER_ALIGNED,PREFER_PRINTF,\
 PREFER_KERNEL_TYPES,PREFER_FALLTHROUGH,BIT_MACRO,CONST_STRUCT,\
 SPLIT_STRING,LONG_LINE_STRING,C99_COMMENT_TOLERANCE,\
 LINE_SPACING,PARENTHESIS_ALIGNMENT,NETWORKING_BLOCK_COMMENT_STYLE,\
-NEW_TYPEDEFS,COMPARISON_TO_NULL"
+NEW_TYPEDEFS,COMPARISON_TO_NULL,STRLCPY"
 options="$options $DPDK_CHECKPATCH_OPTIONS"
 
 print_usage () {