mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RESEND 0/2] coccicheck: Add M= option
@ 2011-11-06  1:59 Gregory.Dietsche
  2011-11-06  1:59 ` [RESEND 1/2] coccicheck: add M= option to control which dir is processed Gregory.Dietsche
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Gregory.Dietsche @ 2011-11-06  1:59 UTC (permalink / raw)
  To: julia, mmarek
  Cc: rdunlap, Gilles.Muller, npalix.work, cocci, linux-doc,
	linux-kernel, Greg Dietsche

From: Greg Dietsche <Gregory.Dietsche@cuw.edu>

This is a re-post of the patches found here: https://lkml.org/lkml/2011/6/7/714

Could I get the appropriate aks/naks to get these into the kernel? Also, I've added Michal Marek to the CC list since it is my understanding that he's the one that will eventually commit these. Thanks!!

---

This patch set adds support for M= to coccicheck. This makes 
using Coccinelle easier for those wishing to check specific
drivers or sub systems with Coccinelle.

Greg Dietsche (2):
  coccicheck: add M= option to control which dir is processed
  coccinelle.txt: update documentation to include M= option

 Documentation/coccinelle.txt |   10 ++++++++--
 scripts/coccicheck           |   19 ++++++++++++++-----
 2 files changed, 22 insertions(+), 7 deletions(-)

-- 
1.7.6.4


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

* [RESEND 1/2] coccicheck: add M= option to control which dir is processed
  2011-11-06  1:59 [RESEND 0/2] coccicheck: Add M= option Gregory.Dietsche
@ 2011-11-06  1:59 ` Gregory.Dietsche
  2011-11-06 18:17   ` Julia Lawall
  2011-11-06  1:59 ` [RESEND 2/2] coccinelle.txt: update documentation to include M= option Gregory.Dietsche
  2012-01-14 21:27 ` [RESEND 0/2] coccicheck: Add " Michal Marek
  2 siblings, 1 reply; 6+ messages in thread
From: Gregory.Dietsche @ 2011-11-06  1:59 UTC (permalink / raw)
  To: julia, mmarek
  Cc: rdunlap, Gilles.Muller, npalix.work, cocci, linux-doc,
	linux-kernel, Greg Dietsche

From: Greg Dietsche <Gregory.Dietsche@cuw.edu>

Examples:
	make coccicheck M=drivers/net/wireless/
	make coccicheck SUBDIRS=drivers/net/wireless/

Version 2:
	fix patch file names when using M=
	tell coccinelle where the include files are

Version 3:
	Add second include option to support out of tree development
	Fix error message

Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
---
 scripts/coccicheck |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/scripts/coccicheck b/scripts/coccicheck
index 1bb1a1b..3c27764 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -9,14 +9,23 @@ if [ "$C" = "1" -o "$C" = "2" ]; then
 #    FLAGS="-ignore_unknown_options -very_quiet"
 #    OPTIONS=$*
 
-# Workaround for Coccinelle < 0.2.3
-    FLAGS="-I $srctree/include -very_quiet"
-    shift $(( $# - 1 ))
-    OPTIONS=$1
+    if [ "$KBUILD_EXTMOD" = "" ] ; then
+        # Workaround for Coccinelle < 0.2.3
+        FLAGS="-I $srctree/include -very_quiet"
+        shift $(( $# - 1 ))
+        OPTIONS=$1
+    else
+	echo M= is not currently supported when C=1 or C=2
+	exit 1
+    fi
 else
     ONLINE=0
     FLAGS="-very_quiet"
-    OPTIONS="-dir $srctree"
+    if [ "$KBUILD_EXTMOD" = "" ] ; then
+        OPTIONS="-dir $srctree"
+    else
+        OPTIONS="-dir $KBUILD_EXTMOD -patch $srctree -I $srctree/include -I $KBUILD_EXTMOD/include"
+    fi
 fi
 
 if [ ! -x "$SPATCH" ]; then
-- 
1.7.6.4


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

* [RESEND 2/2] coccinelle.txt: update documentation to include M= option
  2011-11-06  1:59 [RESEND 0/2] coccicheck: Add M= option Gregory.Dietsche
  2011-11-06  1:59 ` [RESEND 1/2] coccicheck: add M= option to control which dir is processed Gregory.Dietsche
@ 2011-11-06  1:59 ` Gregory.Dietsche
  2011-11-06 18:17   ` Julia Lawall
  2012-01-14 21:27 ` [RESEND 0/2] coccicheck: Add " Michal Marek
  2 siblings, 1 reply; 6+ messages in thread
From: Gregory.Dietsche @ 2011-11-06  1:59 UTC (permalink / raw)
  To: julia, mmarek
  Cc: rdunlap, Gilles.Muller, npalix.work, cocci, linux-doc,
	linux-kernel, Greg Dietsche

From: Greg Dietsche <Gregory.Dietsche@cuw.edu>

Adding documentation for the new M= option which limits Coccinelle
to a specific set of directories.

Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
---
 Documentation/coccinelle.txt |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Documentation/coccinelle.txt b/Documentation/coccinelle.txt
index 96b6903..cf44eb6 100644
--- a/Documentation/coccinelle.txt
+++ b/Documentation/coccinelle.txt
@@ -102,9 +102,15 @@ or
 	make coccicheck COCCI=<my_SP.cocci> MODE=report
 
 
- Using Coccinelle on (modified) files
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Controlling Which Files are Processed by Coccinelle
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+By default the entire kernel source tree is checked.
+
+To apply Coccinelle to a specific directory, M= can be used.
+For example, to check drivers/net/wireless/ one may write:
 
+    make coccicheck M=drivers/net/wireless/
+    
 To apply Coccinelle on a file basis, instead of a directory basis, the
 following command may be used:
 
-- 
1.7.6.4


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

* Re: [RESEND 1/2] coccicheck: add M= option to control which dir is processed
  2011-11-06  1:59 ` [RESEND 1/2] coccicheck: add M= option to control which dir is processed Gregory.Dietsche
@ 2011-11-06 18:17   ` Julia Lawall
  0 siblings, 0 replies; 6+ messages in thread
From: Julia Lawall @ 2011-11-06 18:17 UTC (permalink / raw)
  To: Greg Dietsche
  Cc: julia, mmarek, rdunlap, Gilles.Muller, npalix.work, cocci,
	linux-doc, linux-kernel

On Sat, 5 Nov 2011, Gregory.Dietsche@cuw.edu wrote:

> From: Greg Dietsche <Gregory.Dietsche@cuw.edu>
>
> Examples:
> 	make coccicheck M=drivers/net/wireless/
> 	make coccicheck SUBDIRS=drivers/net/wireless/
>
> Version 2:
> 	fix patch file names when using M=
> 	tell coccinelle where the include files are
>
> Version 3:
> 	Add second include option to support out of tree development
> 	Fix error message
>
> Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>

Acked-by: Julia Lawall <julia.lawall@lip6.fr>

> ---
> scripts/coccicheck |   19 ++++++++++++++-----
> 1 files changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/scripts/coccicheck b/scripts/coccicheck
> index 1bb1a1b..3c27764 100755
> --- a/scripts/coccicheck
> +++ b/scripts/coccicheck
> @@ -9,14 +9,23 @@ if [ "$C" = "1" -o "$C" = "2" ]; then
> #    FLAGS="-ignore_unknown_options -very_quiet"
> #    OPTIONS=$*
>
> -# Workaround for Coccinelle < 0.2.3
> -    FLAGS="-I $srctree/include -very_quiet"
> -    shift $(( $# - 1 ))
> -    OPTIONS=$1
> +    if [ "$KBUILD_EXTMOD" = "" ] ; then
> +        # Workaround for Coccinelle < 0.2.3
> +        FLAGS="-I $srctree/include -very_quiet"
> +        shift $(( $# - 1 ))
> +        OPTIONS=$1
> +    else
> +	echo M= is not currently supported when C=1 or C=2
> +	exit 1
> +    fi
> else
>     ONLINE=0
>     FLAGS="-very_quiet"
> -    OPTIONS="-dir $srctree"
> +    if [ "$KBUILD_EXTMOD" = "" ] ; then
> +        OPTIONS="-dir $srctree"
> +    else
> +        OPTIONS="-dir $KBUILD_EXTMOD -patch $srctree -I $srctree/include -I $KBUILD_EXTMOD/include"
> +    fi
> fi
>
> if [ ! -x "$SPATCH" ]; then
> -- 
> 1.7.6.4
>
>

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

* Re: [RESEND 2/2] coccinelle.txt: update documentation to include M= option
  2011-11-06  1:59 ` [RESEND 2/2] coccinelle.txt: update documentation to include M= option Gregory.Dietsche
@ 2011-11-06 18:17   ` Julia Lawall
  0 siblings, 0 replies; 6+ messages in thread
From: Julia Lawall @ 2011-11-06 18:17 UTC (permalink / raw)
  To: Greg Dietsche
  Cc: julia, mmarek, rdunlap, Gilles.Muller, npalix.work, cocci,
	linux-doc, linux-kernel



On Sat, 5 Nov 2011, Gregory.Dietsche@cuw.edu wrote:

> From: Greg Dietsche <Gregory.Dietsche@cuw.edu>
>
> Adding documentation for the new M= option which limits Coccinelle
> to a specific set of directories.
>
> Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>

Acked-by: Julia Lawall <julia.lawall@lip6.fr>

> ---
> Documentation/coccinelle.txt |   10 ++++++++--
> 1 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/coccinelle.txt b/Documentation/coccinelle.txt
> index 96b6903..cf44eb6 100644
> --- a/Documentation/coccinelle.txt
> +++ b/Documentation/coccinelle.txt
> @@ -102,9 +102,15 @@ or
> 	make coccicheck COCCI=<my_SP.cocci> MODE=report
>
>
> - Using Coccinelle on (modified) files
> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> + Controlling Which Files are Processed by Coccinelle
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +By default the entire kernel source tree is checked.
> +
> +To apply Coccinelle to a specific directory, M= can be used.
> +For example, to check drivers/net/wireless/ one may write:
>
> +    make coccicheck M=drivers/net/wireless/
> +
> To apply Coccinelle on a file basis, instead of a directory basis, the
> following command may be used:
>
> -- 
> 1.7.6.4
>
>

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

* Re: [RESEND 0/2] coccicheck: Add M= option
  2011-11-06  1:59 [RESEND 0/2] coccicheck: Add M= option Gregory.Dietsche
  2011-11-06  1:59 ` [RESEND 1/2] coccicheck: add M= option to control which dir is processed Gregory.Dietsche
  2011-11-06  1:59 ` [RESEND 2/2] coccinelle.txt: update documentation to include M= option Gregory.Dietsche
@ 2012-01-14 21:27 ` Michal Marek
  2 siblings, 0 replies; 6+ messages in thread
From: Michal Marek @ 2012-01-14 21:27 UTC (permalink / raw)
  To: Gregory.Dietsche
  Cc: julia, rdunlap, Gilles.Muller, npalix.work, cocci, linux-doc,
	linux-kernel

On Sat, Nov 05, 2011 at 08:59:42PM -0500, Gregory.Dietsche@cuw.edu wrote:
> From: Greg Dietsche <Gregory.Dietsche@cuw.edu>
> 
> This is a re-post of the patches found here: https://lkml.org/lkml/2011/6/7/714
> 
> Could I get the appropriate aks/naks to get these into the kernel? Also, I've added Michal Marek to the CC list since it is my understanding that he's the one that will eventually commit these. Thanks!!
> 

Applied to kbuild.git#misc, sorry for the delay.

Michal

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

end of thread, other threads:[~2012-01-14 21:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-06  1:59 [RESEND 0/2] coccicheck: Add M= option Gregory.Dietsche
2011-11-06  1:59 ` [RESEND 1/2] coccicheck: add M= option to control which dir is processed Gregory.Dietsche
2011-11-06 18:17   ` Julia Lawall
2011-11-06  1:59 ` [RESEND 2/2] coccinelle.txt: update documentation to include M= option Gregory.Dietsche
2011-11-06 18:17   ` Julia Lawall
2012-01-14 21:27 ` [RESEND 0/2] coccicheck: Add " Michal Marek

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

all inboxes | Powered by JetHome®