]> git.karo-electronics.de Git - linux-beck.git/commitdiff
coccicheck: make SPFLAGS more useful
authorLuis R. Rodriguez <mcgrof@kernel.org>
Wed, 29 Jun 2016 22:14:52 +0000 (15:14 -0700)
committerMichal Marek <mmarek@suse.com>
Fri, 22 Jul 2016 10:13:39 +0000 (12:13 +0200)
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@kernel.org>
Acked-by: Nicolas Palix <nicolas.palix@imag.fr>
Signed-off-by: Michal Marek <mmarek@suse.com>
Documentation/coccinelle.txt
scripts/coccicheck

index 7f773d51fdd91acf10e49875abbe66fff0fae767..bb9632c20cfba31a91e18389777a382b3d19b44f 100644 (file)
@@ -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
index f137b04dfdd37847bee0ac6ae89fa78320d0e46c..5319fae910b466ce83b13e8ce2068002f4870d74 100755 (executable)
@@ -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"