From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752545AbdKHNE1 (ORCPT ); Wed, 8 Nov 2017 08:04:27 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:15229 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751767AbdKHNEZ (ORCPT ); Wed, 8 Nov 2017 08:04:25 -0500 X-IronPort-AV: E=Sophos;i="5.44,364,1505772000"; d="scan'208";a="243906134" Date: Wed, 8 Nov 2017 21:03:35 +0800 (CST) From: Julia Lawall X-X-Sender: jll@hadrien To: Masahiro Yamada cc: "Nicolas Palix (LIG)" , Julia Lawall , cocci@systeme.lip6.fr, Linux Kbuild mailing list , Linux Kernel Mailing List , Gilles Muller , Michal Marek Subject: Re: [PATCH] coccinelle: grep Options and Requires fields more precisely In-Reply-To: Message-ID: References: <1508993438-15325-1-git-send-email-yamada.masahiro@socionext.com> <69422e77-ac67-d23f-59e2-c8d0df1819b6@imag.fr> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-1340539695-1510146264=:2268" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --8323329-1340539695-1510146264=:2268 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Tue, 7 Nov 2017, Masahiro Yamada wrote: > 2017-10-26 16:26 GMT+09:00 Nicolas Palix (LIG) : > > Le 26/10/17 à 06:59, Julia Lawall a écrit : > >> > >> > >> > >> On Thu, 26 Oct 2017, Masahiro Yamada wrote: > >> > >>> Currently, the required version for badzero.cocci is picked up from > >>> its "Comments:" line since it contains the word "Requires". > >>> > >>> Surprisingly, ld-version.sh can extract the version number from the > >>> string "Requires Coccinelle version 1.0.0-rc20 or later", but this > >>> expectation is fragile. Fix the .cocci file. I removed "-rc20" > >>> because ld-version.sh cannot handle it. > >> > >> > >> OK. > >> > >>> Make the coccicheck script to see exact patterns for "Options:" and > >>> "Requires:" in order to avoid accidental matching to what just happens > >>> to appear in comment lines. > >>> > >>> Signed-off-by: Masahiro Yamada > >> > >> > >> Thanks for checking on this! > >> > >> Acked-by: Julia Lawall > > > > Acked-by: Nicolas Palix > > > >> > >>> --- > >>> > >>> scripts/coccicheck | 4 ++-- > >>> scripts/coccinelle/null/badzero.cocci | 2 +- > >>> 2 files changed, 3 insertions(+), 3 deletions(-) > >>> > >>> diff --git a/scripts/coccicheck b/scripts/coccicheck > >>> index 3e21a1b..1bfa2d2 100755 > >>> --- a/scripts/coccicheck > >>> +++ b/scripts/coccicheck > >>> @@ -168,8 +168,8 @@ OPTIONS="$OPTIONS $SPFLAGS" > >>> coccinelle () { > >>> COCCI="$1" > >>> > >>> - OPT=`grep "Option" $COCCI | cut -d':' -f2` > >>> - REQ=`grep "Requires" $COCCI | cut -d':' -f2 | sed "s| ||"` > >>> + OPT=`grep "Options:" $COCCI | cut -d':' -f2` > >>> + REQ=`grep "Requires:" $COCCI | cut -d':' -f2 | sed "s| ||"` > >>> REQ_NUM=$(echo $REQ | ${DIR}/scripts/ld-version.sh) > >>> if [ "$REQ_NUM" != "0" ] ; then > >>> if [ "$SPATCH_VERSION_NUM" -lt "$REQ_NUM" ] ; then > >>> diff --git a/scripts/coccinelle/null/badzero.cocci > >>> b/scripts/coccinelle/null/badzero.cocci > >>> index 5551da2..f597c80 100644 > >>> --- a/scripts/coccinelle/null/badzero.cocci > >>> +++ b/scripts/coccinelle/null/badzero.cocci > >>> @@ -10,7 +10,7 @@ > >>> // Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2. > >>> // Copyright: (C) 2012 Gilles Muller, INRIA/LiP6. GPLv2. > >>> // URL: http://coccinelle.lip6.fr/ > >>> -// Comments: Requires Coccinelle version 1.0.0-rc20 or later > >>> +// Requires: 1.0.0 > >>> // Options: > >>> > >>> virtual patch > >>> -- > >>> 2.7.4 > >>> > >>> > > > > > > -- > > Nicolas Palix > > http://lig-membres.imag.fr/palix/ > > > > > Applied to linux-kbuild/misc. Thanks! julia --8323329-1340539695-1510146264=:2268--