Lines Matching +full:opt +full:- +full:in

2 # SPDX-License-Identifier: GPL-2.0
6 DIR="$(dirname $(readlink -f $0))/.."
9 if [ ! -x "$SPATCH" ]; then
18 -------
20 -m= , --mode= specify the mode use {report, patch, org, context, chain}
21 -v= , --verbose= enable verbose output {1}
22 -j= , --jobs= number of jobs to use {0 - `nproc`}
23 -c= , --cocci= specify cocci script to use
24 -d= , --debug= specify file to store debug log
25 -f= , --sp-flag= pass additional flag to spatch
26 -h , --help display help and exit
29 --------------------------------------------
40 for i in "$@"
42 case $i in
43 -m=*|--mode=*)
47 -v=*|--verbose=*)
51 -j=*|--jobs=*)
55 -c=*|--cocci=*)
59 -d=*|--debug=*)
63 -f=*|--sp-flag=*)
67 -h|--help)
73 if [ ! -e "$FILE" ]; then
82 FLAGS="--very-quiet"
85 OPTIONS="--dir $ZEPHYR_BASE"
87 OPTIONS="--dir $FILE"
90 if [ -z "$J" ]; then
96 OPTIONS="--macro-file $ZEPHYR_BASE/scripts/coccinelle/macros.h $OPTIONS"
99 OPTIONS="--patch $ZEPHYR_BASE $OPTIONS"
105 OPTIONS="$OPTIONS --jobs $NPROC --chunksize 1"
111 echo 'You can specify the mode with "./scripts/coccicheck --mode=<mode>"'
118 echo 'All available modes will be tried (in that order): patch, report, context, org'
119 elif [ "$MODE" = "report" -o "$MODE" = "org" ] ; then
120 FLAGS="--no-show-diff $FLAGS"
124 echo 'Please check for false positives in the output before submitting a patch.'
129 if [ $VERBOSE -ne 0 ] ; then
130 echo "Running ($NPROC in parallel): $@"
135 if [[ $err -ne 0 ]]; then
146 OPT=`grep "Options:" $COCCI | cut -d':' -f2`
147 VIRTUAL=`grep "virtual" $COCCI | cut -d' ' -f2`
150 echo "No available modes found in \"$COCCI\" script."
170 if [ $VERBOSE -ne 0 ] ; then
175 echo "with option(s) \"$OPT\""
179 sed -ne 's|^///||p' $COCCI
192 echo " in $FILE."
198 if [ "`sed -ne 's|^//#||p' $COCCI`" ] ; then
200 sed -ne 's|^//#||p' $COCCI
206 run_cmd_parmap $SPATCH -D patch \
207 $FLAGS --cocci-file $COCCI $OPT $OPTIONS || \
208 run_cmd_parmap $SPATCH -D report \
209 $FLAGS --cocci-file $COCCI $OPT $OPTIONS --no-show-diff || \
210 run_cmd_parmap $SPATCH -D context \
211 $FLAGS --cocci-file $COCCI $OPT $OPTIONS || \
212 run_cmd_parmap $SPATCH -D org \
213 $FLAGS --cocci-file $COCCI $OPT $OPTIONS --no-show-diff || exit 1
215 run_cmd_parmap $SPATCH -D report \
216 $FLAGS --cocci-file $COCCI $OPT $OPTIONS --no-show-diff && \
217 run_cmd_parmap $SPATCH -D context \
218 $FLAGS --cocci-file $COCCI $OPT $OPTIONS || exit 1
220 run_cmd_parmap $SPATCH -D $MODE $FLAGS --cocci-file $COCCI $OPT $OPTIONS || exit 1
226 if [ "$DEBUG_FILE" != "/dev/null" -a "$DEBUG_FILE" != "" ]; then
227 if [ -f $DEBUG_FILE ]; then
236 for f in `find $ZEPHYR_BASE/scripts/coccinelle/ -name '*.cocci' -type f | sort`; do
238 echo '-------------------------------------------------------------------------'