From 86a905a2c6f91346fef5308f5409e0816c89870a Mon Sep 17 00:00:00 2001 From: Nicolas Palix Date: Sat, 2 Mar 2013 22:36:26 +0100 Subject: [PATCH] --- yaml --- r: 373710 b: refs/heads/master c: 9e395550779efa07ee00809a041534b9641fb7a7 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/scripts/coccicheck | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index da2afa09904c..50def9537af9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 35d88a38710583f3b5afc3255d7bc190a50e1af7 +refs/heads/master: 9e395550779efa07ee00809a041534b9641fb7a7 diff --git a/trunk/scripts/coccicheck b/trunk/scripts/coccicheck index 7f0d6a6c5000..cdde8e0670aa 100755 --- a/trunk/scripts/coccicheck +++ b/trunk/scripts/coccicheck @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash SPATCH="`which ${SPATCH:=spatch}`" @@ -11,24 +11,25 @@ else VERBOSE=0 fi +FLAGS="-very_quiet" + +# spatch only allows include directories with the syntax "-I include" +# while gcc also allows "-Iinclude" and "-include include" +COCCIINCLUDE=${LINUXINCLUDE//-I/-I } +COCCIINCLUDE=${COCCIINCLUDE//-include/-I} + if [ "$C" = "1" -o "$C" = "2" ]; then ONLINE=1 -# This requires Coccinelle >= 0.2.3 -# FLAGS="-ignore_unknown_options -very_quiet" -# OPTIONS=$* - -# Workaround for Coccinelle < 0.2.3 - FLAGS="-I $srctree/include -very_quiet" - shift $(( $# - 1 )) - OPTIONS=$1 + # Take only the last argument, which is the C file to test + shift $(( $# - 1 )) + OPTIONS="$COCCIINCLUDE $1" else ONLINE=0 - FLAGS="-very_quiet" if [ "$KBUILD_EXTMOD" = "" ] ; then - OPTIONS="-dir $srctree" + OPTIONS="-dir $srctree $COCCIINCLUDE" else - OPTIONS="-dir $KBUILD_EXTMOD -patch $srctree -I $srctree/include -I $KBUILD_EXTMOD/include" + OPTIONS="-dir $KBUILD_EXTMOD -patch $srctree $COCCIINCLUDE" fi fi