From 26e56720916a2a84704d46268375f204f58bebc8 Mon Sep 17 00:00:00 2001 From: Bernd Schubert Date: Tue, 29 Jan 2013 17:03:37 +0100 Subject: [PATCH] coccicheck: Allow the user to give a V= (verbose) argument 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 CC: Julia Lawall Acked-by: Nicolas Palix Signed-off-by: Michal Marek --- Documentation/coccinelle.txt | 4 ++++ scripts/coccicheck | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Documentation/coccinelle.txt b/Documentation/coccinelle.txt index cf44eb6499b4..dffa2d620d6d 100644 --- a/Documentation/coccinelle.txt +++ b/Documentation/coccinelle.txt @@ -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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/scripts/coccicheck b/scripts/coccicheck index 1a49d1c7ecfe..f8f15a269e1a 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -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 @@ -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/||"` -- 2.11.0