patch 'devtools: fix forbidden token check with multiple files' has been queued to stable release 22.11.7

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Oct 23 23:15:41 CEST 2024


Hi,

FYI, your patch has been queued to stable release 22.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/25/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/8a32360685418604a641b1a6c4c281b7a39250aa

Thanks.

Luca Boccassi

---
>From 8a32360685418604a641b1a6c4c281b7a39250aa Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand at redhat.com>
Date: Thu, 5 Sep 2024 15:29:09 +0200
Subject: [PATCH] devtools: fix forbidden token check with multiple files

[ upstream commit 84cf9b71fc2d6baf1869ef213daee7ec9f8880bc ]

If a patch contains multiple files, it is possible to pass through the
check because the count of token mentions is not reset between file
evaluation.

Example with a fake patch:

  $ cat toto.patch
  --- a/drivers/plop1
  +++ b/drivers/plop1
  - RTE_LOG(
  - RTE_LOG(
  + RTE_LOG(
  --- a/drivers/plop2
  +++ b/drivers/plop2
  + RTE_LOG(

  $ awk -v FOLDERS='drivers' -v EXPRESSIONS='RTE_LOG\\('
    -v MESSAGE='Prefer RTE_LOG_LINE'
    -f devtools/check-forbidden-tokens.awk toto.patch

Besides, the expressions[] array is not used since commit
b467d38284b1 ("devtools: add explicit warnings for forbidden tokens").

Fixes: 42f4d724ec27 ("devtools: move awk script ckecking forbidden tokens")

Signed-off-by: David Marchand <david.marchand at redhat.com>
Acked-by: Thomas Monjalon <thomas at monjalon.net>
---
 devtools/check-forbidden-tokens.awk | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/devtools/check-forbidden-tokens.awk b/devtools/check-forbidden-tokens.awk
index 026844141c..2419d3565a 100755
--- a/devtools/check-forbidden-tokens.awk
+++ b/devtools/check-forbidden-tokens.awk
@@ -32,14 +32,11 @@ BEGIN {
 		for (i in deny_expr) {
 			forbidden_added = "^\\+.*" deny_expr[i];
 			forbidden_removed="^-.*" deny_expr[i];
-			current = expressions[deny_expr[i]]
 			if ($0 ~ forbidden_added) {
-				count = count + 1;
-				expressions[deny_expr[i]] = current + 1
+				count = count + 1
 			}
 			if ($0 ~ forbidden_removed) {
-				count = count - 1;
-				expressions[deny_expr[i]] = current - 1
+				count = count - 1
 			}
 		}
 	}
@@ -49,12 +46,13 @@ BEGIN {
 	}
 }
 # switch to next file , check if the balance of add/remove
-# of previous filehad new additions
+# of previous file had new additions
 ($0 ~ "^\\+\\+\\+ b/") {
 	in_file = 0;
 	if (count > 0) {
 		exit;
 	}
+	count = 0
 	for (i in deny_folders) {
 		re = "^\\+\\+\\+ b/" deny_folders[i];
 		if ($0 ~ re) {
-- 
2.45.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-10-23 22:16:40.603038409 +0100
+++ 0001-devtools-fix-forbidden-token-check-with-multiple-fil.patch	2024-10-23 22:16:40.427939940 +0100
@@ -1 +1 @@
-From 84cf9b71fc2d6baf1869ef213daee7ec9f8880bc Mon Sep 17 00:00:00 2001
+From 8a32360685418604a641b1a6c4c281b7a39250aa Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 84cf9b71fc2d6baf1869ef213daee7ec9f8880bc ]
+
@@ -38 +40 @@
-index 90d3a64f8e..8d64e99570 100755
+index 026844141c..2419d3565a 100755


More information about the stable mailing list