diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/coccicheck | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/scripts/coccicheck b/scripts/coccicheck index 7f0d6a6c5000..cdde8e0670aa 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/bash |
| 2 | 2 | ||
| 3 | SPATCH="`which ${SPATCH:=spatch}`" | 3 | SPATCH="`which ${SPATCH:=spatch}`" |
| 4 | 4 | ||
| @@ -11,24 +11,25 @@ else | |||
| 11 | VERBOSE=0 | 11 | VERBOSE=0 |
| 12 | fi | 12 | fi |
| 13 | 13 | ||
| 14 | FLAGS="-very_quiet" | ||
| 15 | |||
| 16 | # spatch only allows include directories with the syntax "-I include" | ||
| 17 | # while gcc also allows "-Iinclude" and "-include include" | ||
| 18 | COCCIINCLUDE=${LINUXINCLUDE//-I/-I } | ||
| 19 | COCCIINCLUDE=${COCCIINCLUDE//-include/-I} | ||
| 20 | |||
| 14 | if [ "$C" = "1" -o "$C" = "2" ]; then | 21 | if [ "$C" = "1" -o "$C" = "2" ]; then |
| 15 | ONLINE=1 | 22 | ONLINE=1 |
| 16 | 23 | ||
| 17 | # This requires Coccinelle >= 0.2.3 | 24 | # Take only the last argument, which is the C file to test |
| 18 | # FLAGS="-ignore_unknown_options -very_quiet" | 25 | shift $(( $# - 1 )) |
| 19 | # OPTIONS=$* | 26 | OPTIONS="$COCCIINCLUDE $1" |
| 20 | |||
| 21 | # Workaround for Coccinelle < 0.2.3 | ||
| 22 | FLAGS="-I $srctree/include -very_quiet" | ||
| 23 | shift $(( $# - 1 )) | ||
| 24 | OPTIONS=$1 | ||
| 25 | else | 27 | else |
| 26 | ONLINE=0 | 28 | ONLINE=0 |
| 27 | FLAGS="-very_quiet" | ||
| 28 | if [ "$KBUILD_EXTMOD" = "" ] ; then | 29 | if [ "$KBUILD_EXTMOD" = "" ] ; then |
| 29 | OPTIONS="-dir $srctree" | 30 | OPTIONS="-dir $srctree $COCCIINCLUDE" |
| 30 | else | 31 | else |
| 31 | OPTIONS="-dir $KBUILD_EXTMOD -patch $srctree -I $srctree/include -I $KBUILD_EXTMOD/include" | 32 | OPTIONS="-dir $KBUILD_EXTMOD -patch $srctree $COCCIINCLUDE" |
| 32 | fi | 33 | fi |
| 33 | fi | 34 | fi |
| 34 | 35 | ||
