public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Dietsche <gregory.dietsche@cuw.edu>
To: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Cc: julia@diku.dk, rdunlap@xenotime.net, Gilles.Muller@lip6.fr,
	npalix.work@gmail.com, cocci@diku.dk, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] coccicheck: add M= option to control which dir is processed
Date: Wed, 08 Jun 2011 14:00:42 -0500	[thread overview]
Message-ID: <4DEFC6DA.9050809@cuw.edu> (raw)
In-Reply-To: <1307503774-30370-2-git-send-email-Gregory.Dietsche@cuw.edu>



On 06/07/2011 10:29 PM, Greg Dietsche wrote:
> Examples:
> 	make coccicheck M=drivers/net/wireless/
> 	make coccicheck SUBDIRS=drivers/net/wireless/
>
> Signed-off-by: Greg Dietsche<Gregory.Dietsche@cuw.edu>
> ---
>   scripts/coccicheck |   13 +++++++++++--
>   1 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/coccicheck b/scripts/coccicheck
> index 1bb1a1b..6f08efa 100755
> --- a/scripts/coccicheck
> +++ b/scripts/coccicheck
> @@ -10,13 +10,22 @@ if [ "$C" = "1" -o "$C" = "2" ]; then
>   #    OPTIONS=$*
>
>   # Workaround for Coccinelle<  0.2.3
> -    FLAGS="-I $srctree/include -very_quiet"
> +    if [ "$KBUILD_EXTMOD" = "" ] ; then
> +        FLAGS="-I $srctree/include -very_quiet"
> +    else
> +	    echo 'M= is only supported for Coccinelle>= 0.2.3'
> +	    exit 1
> +    fi
>       shift $(( $# - 1 ))
>       OPTIONS=$1
>   else
>       ONLINE=0
>       FLAGS="-very_quiet"
> -    OPTIONS="-dir $srctree"
> +    if [ "$KBUILD_EXTMOD" = "" ] ; then
> +        OPTIONS="-dir $srctree"
> +    else
> +        OPTIONS="-dir $KBUILD_EXTMOD"
>    
So far I've found one bug after reading Nicolas's comments on the other 
thread. In order to have the diffs print file names correctly, I 
definitely need to update my patch to do this:

+        OPTIONS="-dir $KBUILD_EXTMOD -patch $srctree"

Also, do I need to tell cocci where the includes are? Based on my somewhat limited knowledge and testing, I'm not sure... but so far the tests seem to work without it. If we really do need to tell it about the includes, then the line should read:

+        OPTIONS="-dir $KBUILD_EXTMOD -patch $srctree -I $srctree/include"



> +    fi
>   fi
>
>   if [ ! -x "$SPATCH" ]; then
>    

Greg


  reply	other threads:[~2011-06-08 19:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-08  3:29 coccicheck: Add M= option Greg Dietsche
2011-06-08  3:29 ` [PATCH 1/2] coccicheck: add M= option to control which dir is processed Greg Dietsche
2011-06-08 19:00   ` Greg Dietsche [this message]
2011-06-08 19:10     ` Nicolas Palix
2011-06-11 15:29       ` [PATCH 1/2 V2] " Greg Dietsche
2011-06-11 15:33       ` [PATCH 1/2] " Greg Dietsche
2011-06-11 15:40         ` Julia Lawall
2011-06-11 17:22           ` Greg Dietsche
2011-06-11 17:53             ` [PATCH 1/2 v3] " Greg Dietsche
2011-11-04  1:17               ` Greg Dietsche
2011-06-08  3:29 ` [PATCH 2/2] coccinelle.txt: update documentation to include M= option Greg Dietsche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DEFC6DA.9050809@cuw.edu \
    --to=gregory.dietsche@cuw.edu \
    --cc=Gilles.Muller@lip6.fr \
    --cc=cocci@diku.dk \
    --cc=julia@diku.dk \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=npalix.work@gmail.com \
    --cc=rdunlap@xenotime.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox