mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/6] Update coccinelle related files/information
@ 2010-10-08 19:27 Nicolas Palix
  2010-10-08 19:27 ` [PATCH 1/6] MAINTAINERS: Coccinelle: Update email address Nicolas Palix
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Nicolas Palix @ 2010-10-08 19:27 UTC (permalink / raw)
  To: Randy Dunlap, Nicolas Palix, Julia Lawall, Michal Marek,
	Kulikov Vasiliy, Gilles Muller, Sam Ravnborg, Joerg Roedel,
	linux-kernel, linux-doc, cocci

Nicolas Palix (6):
  MAINTAINERS: Coccinelle: Update email address
  Coccinelle: Update documentation
  Coccinelle: Improve user information with a new kind of comment
  Coccinelle: Use new comment format to explain kfree.cocci
  Coccinelle: Add a new mode named 'chain'
  Coccinelle: Use the -no_show_diff option for org and report mode

 Documentation/coccinelle.txt        |   42 +++++++++++++++++++++++++++++-----
 MAINTAINERS                         |    2 +-
 scripts/coccicheck                  |   30 +++++++++++++++++++-----
 scripts/coccinelle/free/kfree.cocci |    9 ++++---
 4 files changed, 64 insertions(+), 19 deletions(-)


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

* [PATCH 1/6] MAINTAINERS: Coccinelle: Update email address
  2010-10-08 19:27 [PATCH 0/6] Update coccinelle related files/information Nicolas Palix
@ 2010-10-08 19:27 ` Nicolas Palix
  2010-10-08 19:27 ` [PATCH 2/6] Coccinelle: Update documentation Nicolas Palix
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Nicolas Palix @ 2010-10-08 19:27 UTC (permalink / raw)
  To: Randy Dunlap, Nicolas Palix, Julia Lawall, Michal Marek,
	Kulikov Vasiliy, Gilles Muller, Sam Ravnborg, Joerg Roedel,
	linux-kernel, linux-doc, cocci

Update my email address

Signed-off-by: Nicolas Palix <npalix.work@gmail.com>
---
 MAINTAINERS |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index e4f9e41..146090d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1479,7 +1479,7 @@ F:	drivers/platform/x86/classmate-laptop.c
 COCCINELLE/Semantic Patches (SmPL)
 M:	Julia Lawall <julia@diku.dk>
 M:	Gilles Muller <Gilles.Muller@lip6.fr>
-M:	Nicolas Palix <npalix@diku.dk>
+M:	Nicolas Palix <npalix.work@gmail.com>
 L:	cocci@diku.dk (moderated for non-subscribers)
 W:	http://coccinelle.lip6.fr/
 S:	Supported
-- 
1.7.0.4


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

* [PATCH 2/6] Coccinelle: Update documentation
  2010-10-08 19:27 [PATCH 0/6] Update coccinelle related files/information Nicolas Palix
  2010-10-08 19:27 ` [PATCH 1/6] MAINTAINERS: Coccinelle: Update email address Nicolas Palix
@ 2010-10-08 19:27 ` Nicolas Palix
  2010-10-11 19:49   ` Randy Dunlap
  2010-10-08 19:27 ` [PATCH 3/6] Coccinelle: Improve user information with a new kind of comment Nicolas Palix
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 10+ messages in thread
From: Nicolas Palix @ 2010-10-08 19:27 UTC (permalink / raw)
  To: Randy Dunlap, Nicolas Palix, Julia Lawall, Michal Marek,
	Kulikov Vasiliy, Gilles Muller, Sam Ravnborg, Joerg Roedel,
	linux-kernel, linux-doc, cocci

 - Add information about use of the C={1,2} make flag
 - Add a description of the new chain mode mechanism
 - Add a link to the wiki

Signed-off-by: Nicolas Palix <npalix.work@gmail.com>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
 Documentation/coccinelle.txt |   42 +++++++++++++++++++++++++++++++++++-------
 1 files changed, 35 insertions(+), 7 deletions(-)

diff --git a/Documentation/coccinelle.txt b/Documentation/coccinelle.txt
index cd2b028..a43eaeb 100644
--- a/Documentation/coccinelle.txt
+++ b/Documentation/coccinelle.txt
@@ -24,6 +24,9 @@ of many distributions, e.g. :
 You can get the latest version released from the Coccinelle homepage at
 http://coccinelle.lip6.fr/
 
+Information and tips about Coccinelle are also provided on the wiki
+pages at http://cocci.ekstranet.diku.dk/wiki/doku.php
+
 Once you have it, run the following command:
 
      	./configure
@@ -41,20 +44,22 @@ A Coccinelle-specific target is defined in the top level
 Makefile. This target is named 'coccicheck' and calls the 'coccicheck'
 front-end in the 'scripts' directory.
 
-Four modes are defined: report, patch, context, and org. The mode to
+Four modes are defined: patch, report, context, and org. The mode to
 use is specified by setting the MODE variable with 'MODE=<mode>'.
 
+'patch' proposes a fix, when possible.
+
 'report' generates a list in the following format:
   file:line:column-column: message
 
-'patch' proposes a fix, when possible.
-
 'context' highlights lines of interest and their context in a
 diff-like style.Lines of interest are indicated with '-'.
 
 'org' generates a report in the Org mode format of Emacs.
 
-Note that not all semantic patches implement all modes.
+Note that not all semantic patches implement all modes. To easy use
+of Coccinelle, the default mode is "chain" which tries the previous
+modes in the order above until one successes. 
 
 To make a report for every semantic patch, run the following command:
 
@@ -68,9 +73,9 @@ To produce patches, run:
 
 
 The coccicheck target applies every semantic patch available in the
-subdirectories of 'scripts/coccinelle' to the entire Linux kernel.
+sub-directories of 'scripts/coccinelle' to the entire Linux kernel.
 
-For each semantic patch, a changelog message is proposed.  It gives a
+For each semantic patch, a commit message is proposed.  It gives a
 description of the problem being checked by the semantic patch, and
 includes a reference to Coccinelle.
 
@@ -93,12 +98,35 @@ or
 	make coccicheck COCCI=<my_SP.cocci> MODE=report
 
 
+ Using Coccinelle on (modified) files
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To apply Coccinelle on a file basis, instead of a directory basis, the
+following command may be used:
+    
+    make C=1 CHECK="scripts/coccicheck"
+    
+To check only newly edited code, use the value 2 for the C flag, i.e.
+    
+    make C=2 CHECK="scripts/coccicheck"
+    
+This runs every semantic patch in scripts/coccinelle by default. The
+COCCI variable may additionally be used to only apply a single
+semantic patch as shown in the previous section.
+
+The "chain" mode is the default. You can select another one with the
+MODE variable explained above.
+
+In this mode, there is no information about semantic patches
+displayed, and no commit message proposed.
+
+
  Proposing new semantic patches
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 New semantic patches can be proposed and submitted by kernel
 developers. For sake of clarity, they should be organized in the
-subdirectories of 'scripts/coccinelle/'.
+sub-directories of 'scripts/coccinelle/'.
 
 
  Detailed description of the 'report' mode
-- 
1.7.0.4


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

* [PATCH 3/6] Coccinelle: Improve user information with a new kind of comment
  2010-10-08 19:27 [PATCH 0/6] Update coccinelle related files/information Nicolas Palix
  2010-10-08 19:27 ` [PATCH 1/6] MAINTAINERS: Coccinelle: Update email address Nicolas Palix
  2010-10-08 19:27 ` [PATCH 2/6] Coccinelle: Update documentation Nicolas Palix
@ 2010-10-08 19:27 ` Nicolas Palix
  2010-10-08 19:27 ` [PATCH 4/6] Coccinelle: Use new comment format to explain kfree.cocci Nicolas Palix
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Nicolas Palix @ 2010-10-08 19:27 UTC (permalink / raw)
  To: Randy Dunlap, Nicolas Palix, Julia Lawall, Michal Marek,
	Kulikov Vasiliy, Gilles Muller, Sam Ravnborg, Joerg Roedel,
	linux-kernel, linux-doc, cocci

Improve user information with a new kind of comment
about semantic patch output.

Fix spelling.

Signed-off-by: Nicolas Palix <npalix.work@gmail.com>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
 scripts/coccicheck |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/scripts/coccicheck b/scripts/coccicheck
index b8bcf1f..ef78c87 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -25,7 +25,7 @@ fi
 
 if [ "$MODE" = "" ] ; then
     if [ "$ONLINE" = "0" ] ; then
-	echo 'You have not explicitly specify the mode to use. Fallback to "report".'
+	echo 'You have not explicitly specified the mode to use. Fallback to "report".'
 	echo 'You can specify the mode with "make coccicheck MODE=<mode>"'
 	echo 'Available modes are: report, patch, context, org'
     fi
@@ -52,10 +52,12 @@ coccinelle () {
 
 	FILE=`echo $COCCI | sed "s|$srctree/||"`
 
-	echo "Processing `basename $COCCI` with option(s) \"$OPT\""
+	echo "Processing `basename $COCCI`"
+	echo "with option(s) \"$OPT\""
+	echo ''
 	echo 'Message example to submit a patch:'
 
-	sed -e '/\/\/\//!d' -e 's|^///||' $COCCI
+	sed -ne 's|^///||p' $COCCI
 
 	echo ' The semantic patch that makes this change is available'
 	echo " in $FILE."
@@ -64,6 +66,12 @@ coccinelle () {
 	echo ' http://coccinelle.lip6.fr/'
 	echo ''
 
+	if [ "`sed -ne 's|^//#||p' $COCCI`" ] ; then
+	    echo 'Semantic patch information:'
+	    sed -ne 's|^//#||p' $COCCI
+	    echo ''
+	fi
+
 	$SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT -dir $srctree || exit 1
     else
 	$SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
-- 
1.7.0.4


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

* [PATCH 4/6] Coccinelle: Use new comment format to explain kfree.cocci
  2010-10-08 19:27 [PATCH 0/6] Update coccinelle related files/information Nicolas Palix
                   ` (2 preceding siblings ...)
  2010-10-08 19:27 ` [PATCH 3/6] Coccinelle: Improve user information with a new kind of comment Nicolas Palix
@ 2010-10-08 19:27 ` Nicolas Palix
  2010-10-08 19:27 ` [PATCH 5/6] Coccinelle: Add a new mode named 'chain' Nicolas Palix
  2010-10-08 19:27 ` [PATCH 6/6] Coccinelle: Use the -no_show_diff option for org and report mode Nicolas Palix
  5 siblings, 0 replies; 10+ messages in thread
From: Nicolas Palix @ 2010-10-08 19:27 UTC (permalink / raw)
  To: Randy Dunlap, Nicolas Palix, Julia Lawall, Michal Marek,
	Kulikov Vasiliy, Gilles Muller, Sam Ravnborg, Joerg Roedel,
	linux-kernel, linux-doc, cocci

Use new comment format to separate proposed commit message
and information about generated false positives

Signed-off-by: Nicolas Palix <npalix.work@gmail.com>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
 scripts/coccinelle/free/kfree.cocci |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/scripts/coccinelle/free/kfree.cocci b/scripts/coccinelle/free/kfree.cocci
index c13a539..f9f79d9 100644
--- a/scripts/coccinelle/free/kfree.cocci
+++ b/scripts/coccinelle/free/kfree.cocci
@@ -1,7 +1,8 @@
-/// Find a use after free.  Values of variables may imply that some
-/// execution paths are not possible, resulting in false positives.
-/// Another source of false positives are macros such as
-/// SCTP_DBG_OBJCNT_DEC that do not actually evaluate their argument
+/// Find a use after free.
+//# Values of variables may imply that some
+//# execution paths are not possible, resulting in false positives.
+//# Another source of false positives are macros such as
+//# SCTP_DBG_OBJCNT_DEC that do not actually evaluate their argument
 ///
 // Confidence: Moderate
 // Copyright: (C) 2010 Nicolas Palix, DIKU.  GPLv2.
-- 
1.7.0.4


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

* [PATCH 5/6] Coccinelle: Add a new mode named 'chain'
  2010-10-08 19:27 [PATCH 0/6] Update coccinelle related files/information Nicolas Palix
                   ` (3 preceding siblings ...)
  2010-10-08 19:27 ` [PATCH 4/6] Coccinelle: Use new comment format to explain kfree.cocci Nicolas Palix
@ 2010-10-08 19:27 ` Nicolas Palix
  2010-10-08 19:27 ` [PATCH 6/6] Coccinelle: Use the -no_show_diff option for org and report mode Nicolas Palix
  5 siblings, 0 replies; 10+ messages in thread
From: Nicolas Palix @ 2010-10-08 19:27 UTC (permalink / raw)
  To: Randy Dunlap, Nicolas Palix, Julia Lawall, Michal Marek,
	Kulikov Vasiliy, Gilles Muller, Sam Ravnborg, Joerg Roedel,
	linux-kernel, linux-doc, cocci

spatch now returns -1 when a virtual rule (given with
-D on the command line) is not defined in the semantic patch.

Using this spatch feature, coccicheck is now
tries several modes by default, in the order:
	patch, report, context, org

Signed-off-by: Nicolas Palix <npalix.work@gmail.com>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
 scripts/coccicheck |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/scripts/coccicheck b/scripts/coccicheck
index ef78c87..c7beb63 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -16,6 +16,7 @@ if [ "$C" = "1" -o "$C" = "2" ]; then
 else
     ONLINE=0
     FLAGS="-very_quiet"
+    OPTIONS="-dir $srctree"
 fi
 
 if [ ! -x "$SPATCH" ]; then
@@ -25,11 +26,11 @@ fi
 
 if [ "$MODE" = "" ] ; then
     if [ "$ONLINE" = "0" ] ; then
-	echo 'You have not explicitly specified the mode to use. Fallback to "report".'
+	echo 'You have not explicitly specified the mode to use. Using default "chain" mode.'
+	echo 'All available modes will be tried (in that order): patch, report, context, org'
 	echo 'You can specify the mode with "make coccicheck MODE=<mode>"'
-	echo 'Available modes are: report, patch, context, org'
     fi
-    MODE="report"
+    MODE="chain"
 fi
 
 if [ "$ONLINE" = "0" ] ; then
@@ -71,10 +72,15 @@ coccinelle () {
 	    sed -ne 's|^//#||p' $COCCI
 	    echo ''
 	fi
+    fi
 
-	$SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT -dir $srctree || exit 1
+    if [ "$MODE" = "chain" ] ; then
+	$SPATCH -D patch   $FLAGS -sp_file $COCCI $OPT $OPTIONS || \
+	$SPATCH -D report  $FLAGS -sp_file $COCCI $OPT $OPTIONS || \
+	$SPATCH -D context $FLAGS -sp_file $COCCI $OPT $OPTIONS || \
+	$SPATCH -D org     $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
     else
-	$SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
+	$SPATCH -D $MODE   $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
     fi
 
 }
-- 
1.7.0.4


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

* [PATCH 6/6] Coccinelle: Use the -no_show_diff option for org and report mode
  2010-10-08 19:27 [PATCH 0/6] Update coccinelle related files/information Nicolas Palix
                   ` (4 preceding siblings ...)
  2010-10-08 19:27 ` [PATCH 5/6] Coccinelle: Add a new mode named 'chain' Nicolas Palix
@ 2010-10-08 19:27 ` Nicolas Palix
  5 siblings, 0 replies; 10+ messages in thread
From: Nicolas Palix @ 2010-10-08 19:27 UTC (permalink / raw)
  To: Randy Dunlap, Nicolas Palix, Julia Lawall, Michal Marek,
	Kulikov Vasiliy, Gilles Muller, Sam Ravnborg, Joerg Roedel,
	linux-kernel, linux-doc, cocci

This allows to write the semantic patches with code sharing
for the matching parts.

Signed-off-by: Nicolas Palix <npalix.work@gmail.com>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
 scripts/coccicheck |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/scripts/coccicheck b/scripts/coccicheck
index c7beb63..7529af1 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -31,6 +31,8 @@ if [ "$MODE" = "" ] ; then
 	echo 'You can specify the mode with "make coccicheck MODE=<mode>"'
     fi
     MODE="chain"
+elif [ "$MODE" = "report" -o "$MODE" = "org" ] ; then
+    FLAGS="$FLAGS -no_show_diff"    
 fi
 
 if [ "$ONLINE" = "0" ] ; then
@@ -75,10 +77,10 @@ coccinelle () {
     fi
 
     if [ "$MODE" = "chain" ] ; then
-	$SPATCH -D patch   $FLAGS -sp_file $COCCI $OPT $OPTIONS || \
-	$SPATCH -D report  $FLAGS -sp_file $COCCI $OPT $OPTIONS || \
-	$SPATCH -D context $FLAGS -sp_file $COCCI $OPT $OPTIONS || \
-	$SPATCH -D org     $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
+	$SPATCH -D patch   $FLAGS -sp_file $COCCI $OPT $OPTIONS               || \
+	$SPATCH -D report  $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || \
+	$SPATCH -D context $FLAGS -sp_file $COCCI $OPT $OPTIONS               || \
+	$SPATCH -D org     $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || exit 1
     else
 	$SPATCH -D $MODE   $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
     fi
-- 
1.7.0.4


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

* Re: [PATCH 2/6] Coccinelle: Update documentation
  2010-10-08 19:27 ` [PATCH 2/6] Coccinelle: Update documentation Nicolas Palix
@ 2010-10-11 19:49   ` Randy Dunlap
  2010-10-12 22:49     ` Nicolas Palix
  0 siblings, 1 reply; 10+ messages in thread
From: Randy Dunlap @ 2010-10-11 19:49 UTC (permalink / raw)
  To: Nicolas Palix
  Cc: Julia Lawall, Michal Marek, Kulikov Vasiliy, Gilles Muller,
	Sam Ravnborg, Joerg Roedel, linux-kernel, linux-doc, cocci

On Fri,  8 Oct 2010 21:27:37 +0200 Nicolas Palix wrote:

>  - Add information about use of the C={1,2} make flag
>  - Add a description of the new chain mode mechanism
>  - Add a link to the wiki
> 
> Signed-off-by: Nicolas Palix <npalix.work@gmail.com>
> Signed-off-by: Julia Lawall <julia@diku.dk>

Michal,
I guess that you will merge this one with the other Coccinelle patches?

Thanks.

Nicolas, please see comments below.

> ---
>  Documentation/coccinelle.txt |   42 +++++++++++++++++++++++++++++++++++-------
>  1 files changed, 35 insertions(+), 7 deletions(-)
> 
> diff --git a/Documentation/coccinelle.txt b/Documentation/coccinelle.txt
> index cd2b028..a43eaeb 100644
> --- a/Documentation/coccinelle.txt
> +++ b/Documentation/coccinelle.txt
> @@ -24,6 +24,9 @@ of many distributions, e.g. :
>  You can get the latest version released from the Coccinelle homepage at
>  http://coccinelle.lip6.fr/
>  
> +Information and tips about Coccinelle are also provided on the wiki
> +pages at http://cocci.ekstranet.diku.dk/wiki/doku.php
> +
>  Once you have it, run the following command:
>  
>       	./configure
> @@ -41,20 +44,22 @@ A Coccinelle-specific target is defined in the top level
>  Makefile. This target is named 'coccicheck' and calls the 'coccicheck'
>  front-end in the 'scripts' directory.
>  
> -Four modes are defined: report, patch, context, and org. The mode to
> +Four modes are defined: patch, report, context, and org. The mode to
>  use is specified by setting the MODE variable with 'MODE=<mode>'.
>  
> +'patch' proposes a fix, when possible.
> +
>  'report' generates a list in the following format:
>    file:line:column-column: message
>  
> -'patch' proposes a fix, when possible.
> -
>  'context' highlights lines of interest and their context in a
>  diff-like style.Lines of interest are indicated with '-'.
>  
>  'org' generates a report in the Org mode format of Emacs.
>  
> -Note that not all semantic patches implement all modes.
> +Note that not all semantic patches implement all modes. To easy use

                                                           For easy use

> +of Coccinelle, the default mode is "chain" which tries the previous
> +modes in the order above until one successes. 

                            until one succeeds.

Also, please drop trailing spaces.

>  
>  To make a report for every semantic patch, run the following command:
>  
> @@ -68,9 +73,9 @@ To produce patches, run:
>  
>  
>  The coccicheck target applies every semantic patch available in the
> -subdirectories of 'scripts/coccinelle' to the entire Linux kernel.
> +sub-directories of 'scripts/coccinelle' to the entire Linux kernel.
>  
> -For each semantic patch, a changelog message is proposed.  It gives a
> +For each semantic patch, a commit message is proposed.  It gives a
>  description of the problem being checked by the semantic patch, and
>  includes a reference to Coccinelle.
>  
> @@ -93,12 +98,35 @@ or
>  	make coccicheck COCCI=<my_SP.cocci> MODE=report
>  
>  
> + Using Coccinelle on (modified) files
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +To apply Coccinelle on a file basis, instead of a directory basis, the
> +following command may be used:
> +    
> +    make C=1 CHECK="scripts/coccicheck"
> +    
> +To check only newly edited code, use the value 2 for the C flag, i.e.
> +    
> +    make C=2 CHECK="scripts/coccicheck"
> +    
> +This runs every semantic patch in scripts/coccinelle by default. The
> +COCCI variable may additionally be used to only apply a single
> +semantic patch as shown in the previous section.
> +
> +The "chain" mode is the default. You can select another one with the
> +MODE variable explained above.
> +
> +In this mode, there is no information about semantic patches
> +displayed, and no commit message proposed.
> +
> +
>   Proposing new semantic patches
>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  
>  New semantic patches can be proposed and submitted by kernel
>  developers. For sake of clarity, they should be organized in the
> -subdirectories of 'scripts/coccinelle/'.
> +sub-directories of 'scripts/coccinelle/'.
>  
>  
>   Detailed description of the 'report' mode
> -- 


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

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

* Re: [PATCH 2/6] Coccinelle: Update documentation
  2010-10-11 19:49   ` Randy Dunlap
@ 2010-10-12 22:49     ` Nicolas Palix
  2010-10-13 12:29       ` Michal Marek
  0 siblings, 1 reply; 10+ messages in thread
From: Nicolas Palix @ 2010-10-12 22:49 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Julia Lawall, Michal Marek, Kulikov Vasiliy, Gilles Muller,
	Sam Ravnborg, Joerg Roedel, linux-kernel, linux-doc, cocci

 - Add information about use of the C={1,2} make flag
 - Add a description of the new chain mode mechanism
 - Add a link to the wiki

Signed-off-by: Nicolas Palix <npalix.work@gmail.com>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
This is a resubmission that fixes trailing whitespaces and a typo.

 Documentation/coccinelle.txt |   42 +++++++++++++++++++++++++++++++++++-------
 1 files changed, 35 insertions(+), 7 deletions(-)

diff --git a/Documentation/coccinelle.txt b/Documentation/coccinelle.txt
index cd2b028..de51a3e 100644
--- a/Documentation/coccinelle.txt
+++ b/Documentation/coccinelle.txt
@@ -24,6 +24,9 @@ of many distributions, e.g. :
 You can get the latest version released from the Coccinelle homepage at
 http://coccinelle.lip6.fr/

+Information and tips about Coccinelle are also provided on the wiki
+pages at http://cocci.ekstranet.diku.dk/wiki/doku.php
+
 Once you have it, run the following command:

      	./configure
@@ -41,20 +44,22 @@ A Coccinelle-specific target is defined in the top level
 Makefile. This target is named 'coccicheck' and calls the 'coccicheck'
 front-end in the 'scripts' directory.

-Four modes are defined: report, patch, context, and org. The mode to
+Four modes are defined: patch, report, context, and org. The mode to
 use is specified by setting the MODE variable with 'MODE=<mode>'.

+'patch' proposes a fix, when possible.
+
 'report' generates a list in the following format:
   file:line:column-column: message

-'patch' proposes a fix, when possible.
-
 'context' highlights lines of interest and their context in a
 diff-like style.Lines of interest are indicated with '-'.

 'org' generates a report in the Org mode format of Emacs.

-Note that not all semantic patches implement all modes.
+Note that not all semantic patches implement all modes. For easy use
+of Coccinelle, the default mode is "chain" which tries the previous
+modes in the order above until one succeeds.

 To make a report for every semantic patch, run the following command:

@@ -68,9 +73,9 @@ To produce patches, run:


 The coccicheck target applies every semantic patch available in the
-subdirectories of 'scripts/coccinelle' to the entire Linux kernel.
+sub-directories of 'scripts/coccinelle' to the entire Linux kernel.

-For each semantic patch, a changelog message is proposed.  It gives a
+For each semantic patch, a commit message is proposed.  It gives a
 description of the problem being checked by the semantic patch, and
 includes a reference to Coccinelle.

@@ -93,12 +98,35 @@ or
 	make coccicheck COCCI=<my_SP.cocci> MODE=report


+ Using Coccinelle on (modified) files
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To apply Coccinelle on a file basis, instead of a directory basis, the
+following command may be used:
+
+    make C=1 CHECK="scripts/coccicheck"
+
+To check only newly edited code, use the value 2 for the C flag, i.e.
+
+    make C=2 CHECK="scripts/coccicheck"
+
+This runs every semantic patch in scripts/coccinelle by default. The
+COCCI variable may additionally be used to only apply a single
+semantic patch as shown in the previous section.
+
+The "chain" mode is the default. You can select another one with the
+MODE variable explained above.
+
+In this mode, there is no information about semantic patches
+displayed, and no commit message proposed.
+
+
  Proposing new semantic patches
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 New semantic patches can be proposed and submitted by kernel
 developers. For sake of clarity, they should be organized in the
-subdirectories of 'scripts/coccinelle/'.
+sub-directories of 'scripts/coccinelle/'.


  Detailed description of the 'report' mode

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

* Re: [PATCH 2/6] Coccinelle: Update documentation
  2010-10-12 22:49     ` Nicolas Palix
@ 2010-10-13 12:29       ` Michal Marek
  0 siblings, 0 replies; 10+ messages in thread
From: Michal Marek @ 2010-10-13 12:29 UTC (permalink / raw)
  To: Nicolas Palix
  Cc: Randy Dunlap, Julia Lawall, Kulikov Vasiliy, Gilles Muller,
	Sam Ravnborg, Joerg Roedel, linux-kernel, linux-doc, cocci

On 13.10.2010 00:49, Nicolas Palix wrote:
>  - Add information about use of the C={1,2} make flag
>  - Add a description of the new chain mode mechanism
>  - Add a link to the wiki
> 
> Signed-off-by: Nicolas Palix <npalix.work@gmail.com>
> Signed-off-by: Julia Lawall <julia@diku.dk>

Thanks, I applied the whole series to kbuild-2.6.git#misc.

Michal

> ---
> This is a resubmission that fixes trailing whitespaces and a typo.
> 
>  Documentation/coccinelle.txt |   42 +++++++++++++++++++++++++++++++++++-------
>  1 files changed, 35 insertions(+), 7 deletions(-)
> 
> diff --git a/Documentation/coccinelle.txt b/Documentation/coccinelle.txt
> index cd2b028..de51a3e 100644
> --- a/Documentation/coccinelle.txt
> +++ b/Documentation/coccinelle.txt
> @@ -24,6 +24,9 @@ of many distributions, e.g. :
>  You can get the latest version released from the Coccinelle homepage at
>  http://coccinelle.lip6.fr/
> 
> +Information and tips about Coccinelle are also provided on the wiki
> +pages at http://cocci.ekstranet.diku.dk/wiki/doku.php
> +
>  Once you have it, run the following command:
> 
>       	./configure
> @@ -41,20 +44,22 @@ A Coccinelle-specific target is defined in the top level
>  Makefile. This target is named 'coccicheck' and calls the 'coccicheck'
>  front-end in the 'scripts' directory.
> 
> -Four modes are defined: report, patch, context, and org. The mode to
> +Four modes are defined: patch, report, context, and org. The mode to
>  use is specified by setting the MODE variable with 'MODE=<mode>'.
> 
> +'patch' proposes a fix, when possible.
> +
>  'report' generates a list in the following format:
>    file:line:column-column: message
> 
> -'patch' proposes a fix, when possible.
> -
>  'context' highlights lines of interest and their context in a
>  diff-like style.Lines of interest are indicated with '-'.
> 
>  'org' generates a report in the Org mode format of Emacs.
> 
> -Note that not all semantic patches implement all modes.
> +Note that not all semantic patches implement all modes. For easy use
> +of Coccinelle, the default mode is "chain" which tries the previous
> +modes in the order above until one succeeds.
> 
>  To make a report for every semantic patch, run the following command:
> 
> @@ -68,9 +73,9 @@ To produce patches, run:
> 
> 
>  The coccicheck target applies every semantic patch available in the
> -subdirectories of 'scripts/coccinelle' to the entire Linux kernel.
> +sub-directories of 'scripts/coccinelle' to the entire Linux kernel.
> 
> -For each semantic patch, a changelog message is proposed.  It gives a
> +For each semantic patch, a commit message is proposed.  It gives a
>  description of the problem being checked by the semantic patch, and
>  includes a reference to Coccinelle.
> 
> @@ -93,12 +98,35 @@ or
>  	make coccicheck COCCI=<my_SP.cocci> MODE=report
> 
> 
> + Using Coccinelle on (modified) files
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +To apply Coccinelle on a file basis, instead of a directory basis, the
> +following command may be used:
> +
> +    make C=1 CHECK="scripts/coccicheck"
> +
> +To check only newly edited code, use the value 2 for the C flag, i.e.
> +
> +    make C=2 CHECK="scripts/coccicheck"
> +
> +This runs every semantic patch in scripts/coccinelle by default. The
> +COCCI variable may additionally be used to only apply a single
> +semantic patch as shown in the previous section.
> +
> +The "chain" mode is the default. You can select another one with the
> +MODE variable explained above.
> +
> +In this mode, there is no information about semantic patches
> +displayed, and no commit message proposed.
> +
> +
>   Proposing new semantic patches
>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
>  New semantic patches can be proposed and submitted by kernel
>  developers. For sake of clarity, they should be organized in the
> -subdirectories of 'scripts/coccinelle/'.
> +sub-directories of 'scripts/coccinelle/'.
> 
> 
>   Detailed description of the 'report' mode


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

end of thread, other threads:[~2010-10-13 12:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-08 19:27 [PATCH 0/6] Update coccinelle related files/information Nicolas Palix
2010-10-08 19:27 ` [PATCH 1/6] MAINTAINERS: Coccinelle: Update email address Nicolas Palix
2010-10-08 19:27 ` [PATCH 2/6] Coccinelle: Update documentation Nicolas Palix
2010-10-11 19:49   ` Randy Dunlap
2010-10-12 22:49     ` Nicolas Palix
2010-10-13 12:29       ` Michal Marek
2010-10-08 19:27 ` [PATCH 3/6] Coccinelle: Improve user information with a new kind of comment Nicolas Palix
2010-10-08 19:27 ` [PATCH 4/6] Coccinelle: Use new comment format to explain kfree.cocci Nicolas Palix
2010-10-08 19:27 ` [PATCH 5/6] Coccinelle: Add a new mode named 'chain' Nicolas Palix
2010-10-08 19:27 ` [PATCH 6/6] Coccinelle: Use the -no_show_diff option for org and report mode Nicolas Palix

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

Powered by JetHome