[02/11] devtools: report all warnings in forbidden token check

Message ID 20240907145433.1479091-3-david.marchand@redhat.com (mailing list archive)
State Superseded
Delegated to: Thomas Monjalon
Headers
Series Use RTE_LOG_LINE in drivers |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

David Marchand Sept. 7, 2024, 2:54 p.m. UTC
Do not stop at the first file that got warnings.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 devtools/check-forbidden-tokens.awk | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
  

Patch

diff --git a/devtools/check-forbidden-tokens.awk b/devtools/check-forbidden-tokens.awk
index 807dad7f48..d72d244d3a 100755
--- a/devtools/check-forbidden-tokens.awk
+++ b/devtools/check-forbidden-tokens.awk
@@ -13,6 +13,7 @@  BEGIN {
 	in_file=0;
 	in_comment=0;
 	count=0;
+	warned=0;
 	comment_start="/*"
 	comment_end="*/"
 }
@@ -50,7 +51,8 @@  BEGIN {
 ($0 ~ "^\\+\\+\\+ b/") {
 	in_file = 0;
 	if (count > 0) {
-		exit;
+		warned = warned + 1
+		print "Warning in " substr(last_file,7) ":"
 	}
 	count = 0
 	for (i in deny_folders) {
@@ -66,7 +68,10 @@  BEGIN {
 }
 END {
 	if (count > 0) {
+		warned = warned + 1
 		print "Warning in " substr(last_file,7) ":"
+	}
+	if (warned > 0) {
 		print MESSAGE
 		exit RET_ON_FAIL
 	}