Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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@kernel.org>
Acked-by: Nicolas Palix <nicolas.palix@imag.fr>
Signed-off-by: Michal Marek <mmarek@suse.com>

authored by

Luis R. Rodriguez and committed by
Michal Marek
8e826ad5 13d94865

+6 -2
+2 -1
Documentation/coccinelle.txt
··· 146 146 ~~~~~~~~~~~~~~~~~~ 147 147 148 148 Additional flags can be passed to spatch through the SPFLAGS 149 - variable. 149 + variable. This works as Coccinelle respects the last flags 150 + given to it when options are in conflict. 150 151 151 152 make SPFLAGS=--use-glimpse coccicheck 152 153 make SPFLAGS=--use-idutils coccicheck
+4 -1
scripts/coccicheck
··· 30 30 NPROC="$J" 31 31 fi 32 32 33 - FLAGS="--very-quiet $SPFLAGS" 33 + FLAGS="--very-quiet" 34 34 35 35 # spatch only allows include directories with the syntax "-I include" 36 36 # while gcc also allows "-Iinclude" and "-include include" ··· 105 105 kill ${SPATCH_PID[$i]} 2>/dev/null 106 106 done 107 107 } 108 + 109 + # You can override heuristics with SPFLAGS, these must always go last 110 + OPTIONS="$OPTIONS $SPFLAGS" 108 111 109 112 coccinelle () { 110 113 COCCI="$1"