Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93f14468 authored by Nicolas Palix's avatar Nicolas Palix Committed by Michal Marek
Browse files

Coccinelle: Update the options used to the new option scheme



spatch has changed its option scheme.
E.g., --no_show_diff is now --no-show-diff

This patch updates:
 - scripts/coccicheck
 - Semantic patches under scripts/coccinelle/

Signed-off-by: default avatarNicolas Palix <nicolas.palix@imag.fr>
Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
parent f7b16711
Loading
Loading
Loading
Loading
+14 −14
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ else
	NPROC="$J"
fi

FLAGS="$SPFLAGS -very_quiet"
FLAGS="$SPFLAGS --very-quiet"

# spatch only allows include directories with the syntax "-I include"
# while gcc also allows "-Iinclude" and "-include include"
@@ -36,14 +36,14 @@ if [ "$C" = "1" -o "$C" = "2" ]; then
else
    ONLINE=0
    if [ "$KBUILD_EXTMOD" = "" ] ; then
        OPTIONS="-dir $srctree $COCCIINCLUDE"
        OPTIONS="--dir $srctree $COCCIINCLUDE"
    else
        OPTIONS="-dir $KBUILD_EXTMOD $COCCIINCLUDE"
        OPTIONS="--dir $KBUILD_EXTMOD $COCCIINCLUDE"
    fi
fi

if [ "$KBUILD_EXTMOD" != "" ] ; then
    OPTIONS="-patch $srctree $OPTIONS"
    OPTIONS="--patch $srctree $OPTIONS"
fi

if [ ! -x "$SPATCH" ]; then
@@ -67,7 +67,7 @@ if [ "$MODE" = "chain" ] ; then
	echo 'All available modes will be tried (in that order): patch, report, context, org'
    fi
elif [ "$MODE" = "report" -o "$MODE" = "org" ] ; then
    FLAGS="$FLAGS -no_show_diff"
    FLAGS="$FLAGS --no-show-diff"
fi

if [ "$ONLINE" = "0" ] ; then
@@ -83,7 +83,7 @@ run_cmd() {
		echo "Running ($NPROC in parallel): $@"
	fi
	for i in $(seq 0 $(( NPROC - 1)) ); do
		eval "$@ -max $NPROC -index $i &"
		eval "$@ --max $NPROC --index $i &"
		SPATCH_PID[$i]=$!
		if [ $VERBOSE -eq 2 ] ; then
			echo "${SPATCH_PID[$i]} running"
@@ -106,7 +106,7 @@ coccinelle () {

    OPT=`grep "Option" $COCCI | cut -d':' -f2`

#   The option '-parse_cocci' can be used to syntactically check the SmPL files.
#   The option '--parse-cocci' can be used to syntactically check the SmPL files.
#
#    $SPATCH -D $MODE $FLAGS -parse_cocci $COCCI $OPT > /dev/null

@@ -147,20 +147,20 @@ coccinelle () {

    if [ "$MODE" = "chain" ] ; then
	run_cmd $SPATCH -D patch   \
		$FLAGS -sp_file $COCCI $OPT $OPTIONS               || \
		$FLAGS --cocci-file $COCCI $OPT $OPTIONS               || \
	run_cmd $SPATCH -D report  \
		$FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || \
		$FLAGS --cocci-file $COCCI $OPT $OPTIONS --no-show-diff || \
	run_cmd $SPATCH -D context \
		$FLAGS -sp_file $COCCI $OPT $OPTIONS               || \
		$FLAGS --cocci-file $COCCI $OPT $OPTIONS               || \
	run_cmd $SPATCH -D org     \
		$FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || exit 1
		$FLAGS --cocci-file $COCCI $OPT $OPTIONS --no-show-diff || exit 1
    elif [ "$MODE" = "rep+ctxt" ] ; then
	run_cmd $SPATCH -D report  \
		$FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff && \
		$FLAGS --cocci-file $COCCI $OPT $OPTIONS --no-show-diff && \
	run_cmd $SPATCH -D context \
		$FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
		$FLAGS --cocci-file $COCCI $OPT $OPTIONS || exit 1
    else
	run_cmd $SPATCH -D $MODE   $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
	run_cmd $SPATCH -D $MODE   $FLAGS --cocci-file $COCCI $OPT $OPTIONS || exit 1
    fi

}
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
// Confidence: High
// Copyright: 2009,2010 Nicolas Palix, DIKU.  GPLv2.
// URL: http://coccinelle.lip6.fr/
// Options: -no_includes -include_headers
// Options: --no-includes --include-headers
//
// Keywords: kmalloc, kzalloc, kcalloc
// Version min: < 2.6.12 kmalloc
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
// Copyright: (C) 2009-2010 Julia Lawall, Nicolas Palix, DIKU.  GPLv2.
// Copyright: (C) 2009-2010 Gilles Muller, INRIA/LiP6.  GPLv2.
// URL: http://coccinelle.lip6.fr/rules/kzalloc.html
// Options: -no_includes -include_headers
// Options: --no-includes --include-headers
//
// Keywords: kmalloc, kzalloc
// Version min: < 2.6.12 kmalloc
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
//
// Confidence: Moderate
// URL: http://coccinelle.lip6.fr/
// Options: -include_headers
// Options: --include-headers

virtual context
virtual org
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
// Copyright: (C) 2011 Gilles Muller, INRIA/LiP6.  GPLv2.
// URL: http://coccinelle.lip6.fr/
// Comments:
// Options: -no_includes -include_headers
// Options: --no-includes --include-headers

virtual patch
virtual org
Loading