public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] coccinelle: fix verbose message about .cocci file being run
@ 2017-10-26  4:55 Masahiro Yamada
  2017-10-26  7:22 ` Nicolas Palix (LIG)
  2017-10-27 23:56 ` Jim Davis
  0 siblings, 2 replies; 6+ messages in thread
From: Masahiro Yamada @ 2017-10-26  4:55 UTC (permalink / raw)
  To: cocci, linux-kbuild, Julia Lawall
  Cc: Masahiro Yamada, Nicolas Palix, linux-kernel, Gilles Muller,
	Michal Marek

If you run coccicheck with V=1 and COCCI=, you will see a strange
path to the semantic patch file.  For example, run the following:

$ make V=1 COCCI=scripts/coccinelle/free/kfree.cocci coccicheck
  [ snip ]
 The semantic patch that makes this report is available
 in scriptcoccinelle/free/kfree.cocci.

Notice "s/" was dropped from "scripts/coccinelle/free/kfree.cocci".

When running coccicheck without O=, $srctree is expanded to ".", which
represents one arbitrary character in the regular expression.  Using
sed is not a good choice here.  Strip $srctree/ simply without sed.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 scripts/coccicheck | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/coccicheck b/scripts/coccicheck
index 1bfa2d2..9d18662 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -186,7 +186,7 @@ coccinelle () {
 
     if [ $VERBOSE -ne 0 -a $ONLINE -eq 0 ] ; then
 
-	FILE=`echo $COCCI | sed "s|$srctree/||"`
+	FILE=${COCCI#$srctree/}
 
 	echo "Processing `basename $COCCI`"
 	echo "with option(s) \"$OPT\""
-- 
2.7.4


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

end of thread, other threads:[~2017-11-08 13:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-26  4:55 [PATCH] coccinelle: fix verbose message about .cocci file being run Masahiro Yamada
2017-10-26  7:22 ` Nicolas Palix (LIG)
2017-11-07  0:27   ` Masahiro Yamada
2017-11-08 13:12     ` Julia Lawall
2017-10-27 23:56 ` Jim Davis
2017-10-28 11:26   ` Masahiro Yamada

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