public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Coccicheck: Improvement for online checking with 'make C=[12]'
@ 2012-10-12  8:48 Nicolas Palix
  2012-11-20  9:58 ` Michal Marek
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Palix @ 2012-10-12  8:48 UTC (permalink / raw)
  To: Julia Lawall, Michal Marek, linux-kernel, cocci; +Cc: Nicolas Palix

This patch replaces an old workaround by a new spatch option,
and adds support for online checking of external modules.

The ignore_unknown_options is present in coccinelle
since the version 0.2.3 of spatch. Most of the distribution
(if not all) already provide a RC of the 1.0.0 version.

This new option allows to preserve all gcc options, e.g. -I,
while checking code. Other gcc-specific options are
discarded by spatch.

The support for external modules is also added.

Signed-off-by: Nicolas Palix <nicolas.palix@imag.fr>
---
 scripts/coccicheck |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/scripts/coccicheck b/scripts/coccicheck
index 823e972..b06b3cd 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -5,14 +5,14 @@ SPATCH="`which ${SPATCH:=spatch}`"
 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
+    # The ignore_unknown_options flag requires Coccinelle >= 0.2.3
+    FLAGS="-ignore_unknown_options -very_quiet"
+    if [ "$KBUILD_EXTMOD" = "" ] ; then
+        OPTIONS="-dir $srctree $*"
+    else
+        OPTIONS="-dir $KBUILD_EXTMOD -patch $srctree -I $srctree/include -I $KBUILD_EXTMOD/include $*"
+    fi
+
 else
     ONLINE=0
     FLAGS="-very_quiet"
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-20  9:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-12  8:48 [PATCH] Coccicheck: Improvement for online checking with 'make C=[12]' Nicolas Palix
2012-11-20  9:58 ` Michal Marek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox