USB: ftdi_sio: fix chars_in_buffer overhead
[cascardo/linux.git] / scripts / coccicheck
index cdde8e0..06fcb33 100755 (executable)
@@ -11,7 +11,7 @@ else
        VERBOSE=0
 fi
 
-FLAGS="-very_quiet"
+FLAGS="$SPFLAGS -very_quiet"
 
 # spatch only allows include directories with the syntax "-I include"
 # while gcc also allows "-Iinclude" and "-include include"
@@ -29,10 +29,14 @@ else
     if [ "$KBUILD_EXTMOD" = "" ] ; then
         OPTIONS="-dir $srctree $COCCIINCLUDE"
     else
-        OPTIONS="-dir $KBUILD_EXTMOD -patch $srctree $COCCIINCLUDE"
+        OPTIONS="-dir $KBUILD_EXTMOD $COCCIINCLUDE"
     fi
 fi
 
+if [ "$KBUILD_EXTMOD" != "" ] ; then
+    OPTIONS="-patch $srctree $OPTIONS"
+fi
+
 if [ ! -x "$SPATCH" ]; then
     echo 'spatch is part of the Coccinelle project and is available at http://coccinelle.lip6.fr/'
     exit 1