Skip to contentSkip to conversation

checkpatches: suppress warning about strlcpy

PATCH Superseded Stephen Hemminger 3 participants 5 messages Sep 10, 2021 – Nov 26, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkpatches: suppress warning about strlcpy

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.

---
 devtools/checkpatches.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
devtools/checkpatches.sh +1 -1
index c314d83a29d3..057208c8e1ea 100755
@@ -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 () {
Signature · 1 line
2.30.2
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Stephen Hemminger

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 :-)

Quoted 2 lines

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

Quoted 20 lines
---
 devtools/checkpatches.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
devtools/checkpatches.sh +1 -1
index c314d83a29d3..057208c8e1ea 100755
@@ -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 () {
Signature · 1 line
2.30.2
#2 lore raw

PATCH v2 1/1 checkpatches: suppress warning about strlcpy

In reply to Stephen Hemminger

Current version of Linux kernel checkpatch now complains about usages of strlcpy because the Linux kernel perfers strcspy.

WARNING:STRLCPY: Prefer strscpy over strlcpy

But DPDK project allows strlcpy, therefore suppress the warning.

---
v2 - fix typo in commit messag

 devtools/checkpatches.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
devtools/checkpatches.sh +1 -1
index c314d83a29d3..057208c8e1ea 100755
@@ -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 () {
Signature · 1 line
2.30.2
#3 lore raw

PATCH v3 1/1 checkpatches: suppress warning about strlcpy

In reply to Stephen Hemminger

Current version of Linux kernel checkpatch now complains about usages of strlcpy because the Linux kernel prefers strcspy.

WARNING:STRLCPY: Prefer strscpy over strlcpy

But DPDK project allows strlcpy, therefore suppress the warning.

---
v3 - yet another commit message typo

 devtools/checkpatches.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
devtools/checkpatches.sh +1 -1
index c314d83a29d3..057208c8e1ea 100755
@@ -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 () {
Signature · 1 line
2.30.2
#4 lore raw

16/11/2021 00:26, Stephen Hemminger:

Quoted 11 lines

Current version of Linux kernel checkpatch now complains about usages of strlcpy because the Linux kernel prefers strcspy.

WARNING:STRLCPY: Prefer strscpy over strlcpy

But DPDK project allows strlcpy, therefore suppress the warning.

---
v3 - yet another commit message typo

There is yet another typo that I fixed: strcspy -> strscpy

Applied, thanks.