[PATCH] devtools: fix regex matching literal plus in patches

Thomas Monjalon thomas at monjalon.net
Tue May 5 16:03:52 CEST 2026


In Extended Regular Expressions (ERE) as used in awk,
'+' is a quantifier, not a literal character.
The pattern /^+/ matches the start of any line
instead of only lines beginning with a literal '+'.
As a result, check_experimental_tags and check_internal_tags
were matching context and removed lines in diffs, causing false positives.

Use [+] character class to unambiguously match a literal '+'.

Fixes: cfe3aeb170b2 ("remove experimental tags from all symbol definitions")
Fixes: fba5af82adc8 ("eal: add internal ABI tag definition")
Cc: stable at dpdk.org

Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
---
 devtools/checkpatches.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index 1c6099ac82..f5dd77443f 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -321,10 +321,10 @@ check_experimental_tags() { # <patch>
 		current_file = "";
 		ret = 0;
 	}
-	/^+++ b\// {
+	/^[+][+][+] b\// {
 		current_file = $2;
 	}
-	/^+.*__rte_experimental/ {
+	/^[+].*__rte_experimental/ {
 		if (current_file ~ ".c$" ) {
 			print "Please only put __rte_experimental tags in " \
 				"headers ("current_file")";
@@ -351,10 +351,10 @@ check_internal_tags() { # <patch>
 		current_file = "";
 		ret = 0;
 	}
-	/^+++ b\// {
+	/^[+][+][+] b\// {
 		current_file = $2;
 	}
-	/^+.*__rte_internal/ {
+	/^[+].*__rte_internal/ {
 		if (current_file ~ ".c$" ) {
 			print "Please only put __rte_internal tags in " \
 				"headers ("current_file")";
-- 
2.54.0



More information about the dev mailing list