]> git.droids-corp.org - dpdk.git/commitdiff
devtools: fix comment detection in forbidden token check
authorDavid Marchand <david.marchand@redhat.com>
Thu, 27 Jan 2022 10:55:11 +0000 (11:55 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 27 Jan 2022 16:17:41 +0000 (17:17 +0100)
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")
Cc: stable@dpdk.org
Reported-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: David Marchand <david.marchand@redhat.com>
devtools/check-forbidden-tokens.awk

index 61ba707c9bab085f5c35ee4d9e177101ddd56d72..026844141c8394afc09ccfae1d63de0b666497b4 100755 (executable)
@@ -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