Skip to content

Commit 8e826ad

Browse files
mcgrofMichal Marek
authored and
Michal Marek
committed
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 <[email protected]> Acked-by: Nicolas Palix <[email protected]> Signed-off-by: Michal Marek <[email protected]>
1 parent 13d9486 commit 8e826ad

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Documentation/coccinelle.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ MODE variable explained above.
146146
~~~~~~~~~~~~~~~~~~
147147

148148
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.
150151

151152
make SPFLAGS=--use-glimpse coccicheck
152153
make SPFLAGS=--use-idutils coccicheck

scripts/coccicheck

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ else
3030
NPROC="$J"
3131
fi
3232

33-
FLAGS="--very-quiet $SPFLAGS"
33+
FLAGS="--very-quiet"
3434

3535
# spatch only allows include directories with the syntax "-I include"
3636
# while gcc also allows "-Iinclude" and "-include include"
@@ -106,6 +106,9 @@ kill_running() {
106106
done
107107
}
108108

109+
# You can override heuristics with SPFLAGS, these must always go last
110+
OPTIONS="$OPTIONS $SPFLAGS"
111+
109112
coccinelle () {
110113
COCCI="$1"
111114

0 commit comments

Comments
 (0)