All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Palix <npalix@diku.dk>
To: Kulikov Vasiliy <segooon@gmail.com>
Cc: Kernel Janitors <kernel-janitors@vger.kernel.org>,
	Julia Lawall <julia@diku.dk>,
	Gilles Muller <Gilles.Muller@lip6.fr>,
	Michal Marek <mmarek@suse.cz>, Sam Ravnborg <sam@ravnborg.org>,
	Joerg Roedel <joerg.roedel@amd.com>,
	cocci@diku.dk, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] coccicheck: use $KBUILD_EXTMOD when available
Date: Sat, 03 Jul 2010 19:49:30 +0000	[thread overview]
Message-ID: <201007032149.30704.npalix@diku.dk> (raw)
In-Reply-To: <1278170438-8136-1-git-send-email-segooon@gmail.com>

Hi,

On Saturday 03 July 2010 17:20:34 Kulikov Vasiliy wrote:
> Use $KBUILD_EXTMOD instead of $srctree when the latter is not null
> to use make M=somedir.
> 
> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
> ---
>  scripts/coccicheck |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
> 
> diff --git a/scripts/coccicheck b/scripts/coccicheck
> index b8bcf1f..7d66a55 100755
> --- a/scripts/coccicheck
> +++ b/scripts/coccicheck
> @@ -1,5 +1,11 @@
>  #!/bin/sh
>  
> +if [ -n "$KBUILD_EXTMOD" ]; then
> +	CHECK_DIR="$KBUILD_EXTMOD"
> +else
> +	CHECK_DIR="$srctree"
> +fi
> +
>  SPATCH="`which ${SPATCH:=spatch}`"
>  
>  if [ "$C" = "1" -o "$C" = "2" ]; then
> @@ -64,7 +70,7 @@ coccinelle () {
>  	echo ' http://coccinelle.lip6.fr/'
>  	echo ''
>  
> -	$SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT -dir $srctree || exit 1
> +	$SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT -dir $CHECK_DIR || exit 1
>      else
>  	$SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
>      fi
> 

In doing so, the output of the patch mode will produce patches relative to $KBUILD_EXTMOD.
I am not sure of what most of developers want but if the patches must be relative to
the Linux kernel root, the following patch must be used.

Any preference ?


diff --git a/scripts/coccicheck b/scripts/coccicheck
index b8bcf1f..cda66a3 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -1,5 +1,12 @@
 #!/bin/sh
 
+if [ -n "$KBUILD_EXTMOD" ]; then
+       CHECK_DIR="$srctree/$KBUILD_EXTMOD"
+       FLAGS="-patch $srctree"
+else
+       CHECK_DIR="$srctree"
+fi
+
 SPATCH="`which ${SPATCH:=spatch}`"
 
 if [ "$C" = "1" -o "$C" = "2" ]; then
@@ -10,12 +17,12 @@ if [ "$C" = "1" -o "$C" = "2" ]; then
 #    OPTIONS=$*
 
 # Workaround for Coccinelle < 0.2.3
-    FLAGS="-I $srctree/include -very_quiet"
+    FLAGS="-I $srctree/include -very_quiet $FLAGS"
     shift $(( $# - 1 ))
     OPTIONS=$1
 else
     ONLINE=0
-    FLAGS="-very_quiet"
+    FLAGS="-very_quiet $FLAGS"
 fi
 
 if [ ! -x "$SPATCH" ]; then
@@ -64,7 +71,7 @@ coccinelle () {
        echo ' http://coccinelle.lip6.fr/'
        echo ''
 
-       $SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT -dir $srctree || exit 1
+       $SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT -dir $CHECK_DIR || exit 1
     else
        $SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
     fi

--
Nicolas Palix
Web: http://www.diku.dk/~npalix/

WARNING: multiple messages have this Message-ID (diff)
From: Nicolas Palix <npalix@diku.dk>
To: Kulikov Vasiliy <segooon@gmail.com>
Cc: Kernel Janitors <kernel-janitors@vger.kernel.org>,
	Julia Lawall <julia@diku.dk>,
	Gilles Muller <Gilles.Muller@lip6.fr>,
	Michal Marek <mmarek@suse.cz>, Sam Ravnborg <sam@ravnborg.org>,
	Joerg Roedel <joerg.roedel@amd.com>,
	cocci@diku.dk, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] coccicheck: use $KBUILD_EXTMOD when available
Date: Sat, 3 Jul 2010 21:49:30 +0200	[thread overview]
Message-ID: <201007032149.30704.npalix@diku.dk> (raw)
In-Reply-To: <1278170438-8136-1-git-send-email-segooon@gmail.com>

Hi,

On Saturday 03 July 2010 17:20:34 Kulikov Vasiliy wrote:
> Use $KBUILD_EXTMOD instead of $srctree when the latter is not null
> to use make M=somedir.
> 
> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
> ---
>  scripts/coccicheck |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
> 
> diff --git a/scripts/coccicheck b/scripts/coccicheck
> index b8bcf1f..7d66a55 100755
> --- a/scripts/coccicheck
> +++ b/scripts/coccicheck
> @@ -1,5 +1,11 @@
>  #!/bin/sh
>  
> +if [ -n "$KBUILD_EXTMOD" ]; then
> +	CHECK_DIR="$KBUILD_EXTMOD"
> +else
> +	CHECK_DIR="$srctree"
> +fi
> +
>  SPATCH="`which ${SPATCH:=spatch}`"
>  
>  if [ "$C" = "1" -o "$C" = "2" ]; then
> @@ -64,7 +70,7 @@ coccinelle () {
>  	echo ' http://coccinelle.lip6.fr/'
>  	echo ''
>  
> -	$SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT -dir $srctree || exit 1
> +	$SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT -dir $CHECK_DIR || exit 1
>      else
>  	$SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
>      fi
> 

In doing so, the output of the patch mode will produce patches relative to $KBUILD_EXTMOD.
I am not sure of what most of developers want but if the patches must be relative to
the Linux kernel root, the following patch must be used.

Any preference ?


diff --git a/scripts/coccicheck b/scripts/coccicheck
index b8bcf1f..cda66a3 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -1,5 +1,12 @@
 #!/bin/sh
 
+if [ -n "$KBUILD_EXTMOD" ]; then
+       CHECK_DIR="$srctree/$KBUILD_EXTMOD"
+       FLAGS="-patch $srctree"
+else
+       CHECK_DIR="$srctree"
+fi
+
 SPATCH="`which ${SPATCH:=spatch}`"
 
 if [ "$C" = "1" -o "$C" = "2" ]; then
@@ -10,12 +17,12 @@ if [ "$C" = "1" -o "$C" = "2" ]; then
 #    OPTIONS=$*
 
 # Workaround for Coccinelle < 0.2.3
-    FLAGS="-I $srctree/include -very_quiet"
+    FLAGS="-I $srctree/include -very_quiet $FLAGS"
     shift $(( $# - 1 ))
     OPTIONS=$1
 else
     ONLINE=0
-    FLAGS="-very_quiet"
+    FLAGS="-very_quiet $FLAGS"
 fi
 
 if [ ! -x "$SPATCH" ]; then
@@ -64,7 +71,7 @@ coccinelle () {
        echo ' http://coccinelle.lip6.fr/'
        echo ''
 
-       $SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT -dir $srctree || exit 1
+       $SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT -dir $CHECK_DIR || exit 1
     else
        $SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
     fi

--
Nicolas Palix
Web: http://www.diku.dk/~npalix/

  reply	other threads:[~2010-07-03 19:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-03 15:20 [PATCH] coccicheck: use $KBUILD_EXTMOD when available Kulikov Vasiliy
2010-07-03 15:20 ` Kulikov Vasiliy
2010-07-03 19:49 ` Nicolas Palix [this message]
2010-07-03 19:49   ` Nicolas Palix
2010-07-04  8:41   ` Kulikov Vasiliy
2010-07-04  8:41     ` Kulikov Vasiliy
2010-07-07 11:04   ` Michal Marek
2010-07-07 11:04     ` Michal Marek
2010-07-07 12:22     ` Nicolas Palix
2010-07-07 12:22       ` Nicolas Palix
2010-07-05 12:48 ` Nicolas Palix
2010-07-05 12:48   ` Nicolas Palix

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=201007032149.30704.npalix@diku.dk \
    --to=npalix@diku.dk \
    --cc=Gilles.Muller@lip6.fr \
    --cc=cocci@diku.dk \
    --cc=joerg.roedel@amd.com \
    --cc=julia@diku.dk \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    --cc=sam@ravnborg.org \
    --cc=segooon@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.