From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org, thomas@monjalon.net
Subject: [dpdk-dev] [PATCH 2/2] devtools: fix forbidden token
Date: Mon, 6 Jul 2020 10:00:22 +0200 [thread overview]
Message-ID: <20200706080022.3887-2-david.marchand@redhat.com> (raw)
In-Reply-To: <20200706080022.3887-1-david.marchand@redhat.com>
An expression with a space is split by the awk script resulting in
false positive for any patch matching any of the two part of the
expression.
Fix this by using [[:space:]].
Fixes: 43e73483a4b8 ("devtools: forbid variable declaration inside for")
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
devtools/checkpatches.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index 27ab1252b7..58021aa5dd 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -71,7 +71,7 @@ check_forbidden_additions() { # <patch>
# forbid variable declaration inside "for" loop
awk -v FOLDERS='.' \
- -v EXPRESSIONS='for *\\((char|u?int|unsigned|s?size_t)' \
+ -v EXPRESSIONS='for[[:space:]]*\\((char|u?int|unsigned|s?size_t)' \
-v RET_ON_FAIL=1 \
-v MESSAGE='Declaring a variable inside for()' \
-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
--
2.23.0
next prev parent reply other threads:[~2020-07-06 8:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-06 8:00 [dpdk-dev] [PATCH 1/2] devtools: fix filename in forbidden token check David Marchand
2020-07-06 8:00 ` David Marchand [this message]
2020-07-06 8:56 ` [dpdk-dev] [PATCH 2/2] devtools: fix forbidden token Thomas Monjalon
2020-07-06 9:50 ` [dpdk-dev] [PATCH 1/2] devtools: fix filename in forbidden token check Arnon Warshavsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200706080022.3887-2-david.marchand@redhat.com \
--to=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).