[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1467238499-10889-3-git-send-email-mcgrof@kernel.org>
Date: Wed, 29 Jun 2016 15:14:52 -0700
From: "Luis R. Rodriguez" <mcgrof@...nel.org>
To: Julia.Lawall@...6.fr, nicolas.palix@...g.fr, Gilles.Muller@...6.fr,
mmarek@...e.com
Cc: akpm@...ux-foundation.org, gregkh@...uxfoundation.org,
markivx@...eaurora.org, stephen.boyd@...aro.org,
zohar@...ux.vnet.ibm.com, broonie@...nel.org,
ming.lei@...onical.com, tiwai@...e.d, johannes@...solutions.net,
chunkeey@...glemail.com, hauke@...ke-m.de,
jwboyer@...oraproject.org, dmitry.torokhov@...il.com,
dwmw2@...radead.org, jslaby@...e.com,
torvalds@...ux-foundation.org, deepa.kernel@...il.com,
keescook@...omium.org, cocci@...teme.lip6.fr,
linux-kernel@...r.kernel.org,
"Luis R. Rodriguez" <mcgrof@...nel.org>
Subject: [PATCH v4 2/9] coccicheck: make SPFLAGS more useful
SPFLAGS is set early, it means that any heuristics done on
coccicheck cannot be overridden currently. Move SPFLAGS
after OPTIONS and set this at the end. This lets you override
any heuristics as coccinelle treats conflicts by only listening
to the last option that makes sense.
v3: this patch was added in the v3 series
v4: Update Documentation/coccinelle.txt explaining how
SPFLAGS works as well.
Signed-off-by: Luis R. Rodriguez <mcgrof@...nel.org>
Acked-by: Nicolas Palix <nicolas.palix@...g.fr>
---
Documentation/coccinelle.txt | 3 ++-
scripts/coccicheck | 5 ++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/Documentation/coccinelle.txt b/Documentation/coccinelle.txt
index 7f773d51fdd9..bb9632c20cfb 100644
--- a/Documentation/coccinelle.txt
+++ b/Documentation/coccinelle.txt
@@ -146,7 +146,8 @@ MODE variable explained above.
~~~~~~~~~~~~~~~~~~
Additional flags can be passed to spatch through the SPFLAGS
-variable.
+variable. This works as Coccinelle respects the last flags
+given to it when options are in conflict.
make SPFLAGS=--use-glimpse coccicheck
make SPFLAGS=--use-idutils coccicheck
diff --git a/scripts/coccicheck b/scripts/coccicheck
index f137b04dfdd3..5319fae910b4 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -30,7 +30,7 @@ else
NPROC="$J"
fi
-FLAGS="--very-quiet $SPFLAGS"
+FLAGS="--very-quiet"
# spatch only allows include directories with the syntax "-I include"
# while gcc also allows "-Iinclude" and "-include include"
@@ -106,6 +106,9 @@ kill_running() {
done
}
+# You can override heuristics with SPFLAGS, these must always go last
+OPTIONS="$OPTIONS $SPFLAGS"
+
coccinelle () {
COCCI="$1"
--
2.8.4
Powered by blists - more mailing lists