From 4ee719c72ea69336a8d9b6688e8a5536b87bc3a9 Mon Sep 17 00:00:00 2001 From: David Marchand Date: Thu, 27 Jan 2022 11:55:11 +0100 Subject: [PATCH] devtools: fix comment detection in forbidden token check [ upstream commit fdcc8970bce23d476e7fabd18a82fb298725c511 ] After a comment section was detected, passing to a new hunk was not seen as ending the section and all subsequent hunks were ignored. Fixes: 7413e7f2aeb3 ("devtools: alert on new calls to exit from libs") Reported-by: Thomas Monjalon Signed-off-by: David Marchand --- devtools/check-forbidden-tokens.awk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/devtools/check-forbidden-tokens.awk b/devtools/check-forbidden-tokens.awk index 61ba707c9b..026844141c 100755 --- a/devtools/check-forbidden-tokens.awk +++ b/devtools/check-forbidden-tokens.awk @@ -20,6 +20,9 @@ BEGIN { # state machine assumes the comments structure is enforced by # checkpatches.pl (in_file) { + if ($0 ~ "^@@") { + in_comment = 0 + } # comment start if (index($0,comment_start) > 0) { in_comment = 1