Skip to content

Commit

Permalink
coccicheck: Allow the user to give a V= (verbose) argument
Browse files Browse the repository at this point in the history
Do not run with verbosity on/off depending on the ONLINE variable,
which gets set with C=1 or C=2, but allow the user to set the
verbosity using kernel default make V= paramemter.
Verbosity is off by default now.

Signed-off-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Nicolas Palix <nicolas.palix@imag.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>
  • Loading branch information
Bernd Schubert authored and Michal Marek committed Feb 22, 2013
1 parent ff3771c commit 26e5672
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Documentation/coccinelle.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ As any static code analyzer, Coccinelle produces false
positives. Thus, reports must be carefully checked, and patches
reviewed.

To enable verbose messages set the V= variable, for example:

make coccicheck MODE=report V=1


Using Coccinelle with a single semantic patch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
11 changes: 10 additions & 1 deletion scripts/coccicheck
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

SPATCH="`which ${SPATCH:=spatch}`"

# The verbosity may be set by the environmental parameter V=
# as for example with 'make V=1 coccicheck'

if [ -n "$V" -a "$V" != "0" ]; then
VERBOSE=1
else
VERBOSE=0
fi

if [ "$C" = "1" -o "$C" = "2" ]; then
ONLINE=1

Expand Down Expand Up @@ -55,7 +64,7 @@ coccinelle () {
#
# $SPATCH -D $MODE $FLAGS -parse_cocci $COCCI $OPT > /dev/null

if [ "$ONLINE" = "0" ] ; then
if [ $VERBOSE -ne 0 ] ; then

FILE=`echo $COCCI | sed "s|$srctree/||"`

Expand Down

0 comments on commit 26e5672

Please sign in to comment.