Re: [PATCH] Coccinelle: memdup: Fix typo in warning messages
Le 01/03/2018 à 09:57, Dafna Hirschfeld a écrit : Replace 'kmemdep' with 'kmemdup' in warning messages. Signed-off-by: Dafna HirschfeldAcked-by: Julia Lawall Acked-by: Nicolas Palix --- scripts/coccinelle/api/memdup.cocci | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/coccinelle/api/memdup.cocci b/scripts/coccinelle/api/memdup.cocci index 1249b72..8fd6437 100644 --- a/scripts/coccinelle/api/memdup.cocci +++ b/scripts/coccinelle/api/memdup.cocci @@ -56,10 +56,10 @@ statement S; p << r.p; @@ -coccilib.org.print_todo(p[0], "WARNING opportunity for kmemdep") +coccilib.org.print_todo(p[0], "WARNING opportunity for kmemdup") @script:python depends on report@ p << r.p; @@ -coccilib.report.print_report(p[0], "WARNING opportunity for kmemdep") +coccilib.report.print_report(p[0], "WARNING opportunity for kmemdup") -- Nicolas Palix http://lig-membres.imag.fr/palix/
Re: [PATCH] Coccinelle: memdup: Fix typo in warning messages
Le 01/03/2018 à 09:57, Dafna Hirschfeld a écrit : Replace 'kmemdep' with 'kmemdup' in warning messages. Signed-off-by: Dafna Hirschfeld Acked-by: Julia Lawall Acked-by: Nicolas Palix --- scripts/coccinelle/api/memdup.cocci | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/coccinelle/api/memdup.cocci b/scripts/coccinelle/api/memdup.cocci index 1249b72..8fd6437 100644 --- a/scripts/coccinelle/api/memdup.cocci +++ b/scripts/coccinelle/api/memdup.cocci @@ -56,10 +56,10 @@ statement S; p << r.p; @@ -coccilib.org.print_todo(p[0], "WARNING opportunity for kmemdep") +coccilib.org.print_todo(p[0], "WARNING opportunity for kmemdup") @script:python depends on report@ p << r.p; @@ -coccilib.report.print_report(p[0], "WARNING opportunity for kmemdep") +coccilib.report.print_report(p[0], "WARNING opportunity for kmemdup") -- Nicolas Palix http://lig-membres.imag.fr/palix/
Re: [PATCH] coccinelle: grep Options and Requires fields more precisely
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 YamadaThanks 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/ smime.p7s Description: Signature cryptographique S/MIME
Re: [PATCH] coccinelle: grep Options and Requires fields more precisely
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/ smime.p7s Description: Signature cryptographique S/MIME
Re: [PATCH] coccinelle: fix verbose message about .cocci file being run
Le 26/10/17 à 06:55, Masahiro Yamada a écrit : If you run coccicheck with V=1 and COCCI=, you will see a strange path to the semantic patch file. For example, run the following: $ make V=1 COCCI=scripts/coccinelle/free/kfree.cocci coccicheck [ snip ] The semantic patch that makes this report is available in scriptcoccinelle/free/kfree.cocci. Notice "s/" was dropped from "scripts/coccinelle/free/kfree.cocci". When running coccicheck without O=, $srctree is expanded to ".", which represents one arbitrary character in the regular expression. Using sed is not a good choice here. Strip $srctree/ simply without sed. Signed-off-by: Masahiro YamadaAcked-by: Nicolas Palix --- scripts/coccicheck | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/coccicheck b/scripts/coccicheck index 1bfa2d2..9d18662 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -186,7 +186,7 @@ coccinelle () { if [ $VERBOSE -ne 0 -a $ONLINE -eq 0 ] ; then - FILE=`echo $COCCI | sed "s|$srctree/||"` + FILE=${COCCI#$srctree/} echo "Processing `basename $COCCI`" echo "with option(s) \"$OPT\"" -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME
Re: [PATCH] coccinelle: fix verbose message about .cocci file being run
Le 26/10/17 à 06:55, Masahiro Yamada a écrit : If you run coccicheck with V=1 and COCCI=, you will see a strange path to the semantic patch file. For example, run the following: $ make V=1 COCCI=scripts/coccinelle/free/kfree.cocci coccicheck [ snip ] The semantic patch that makes this report is available in scriptcoccinelle/free/kfree.cocci. Notice "s/" was dropped from "scripts/coccinelle/free/kfree.cocci". When running coccicheck without O=, $srctree is expanded to ".", which represents one arbitrary character in the regular expression. Using sed is not a good choice here. Strip $srctree/ simply without sed. Signed-off-by: Masahiro Yamada Acked-by: Nicolas Palix --- scripts/coccicheck | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/coccicheck b/scripts/coccicheck index 1bfa2d2..9d18662 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -186,7 +186,7 @@ coccinelle () { if [ $VERBOSE -ne 0 -a $ONLINE -eq 0 ] ; then - FILE=`echo $COCCI | sed "s|$srctree/||"` + FILE=${COCCI#$srctree/} echo "Processing `basename $COCCI`" echo "with option(s) \"$OPT\"" -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME
Re: [PATCH] coccicheck: improve pattern for getting relative path
Le 10/08/17 à 19:40, Cihangir Akturk a écrit : When invoked with V=1, coccicheck script prints the information about which semantic patch (*.cocci file) used for this operation. Actually, it prints out the relative path of the related semantic patch. The script uses sed to remove the source tree part from cocci file path like so: FILE=`echo $COCCI | sed "s|$srctree/||"` This pattern works well most of the time. But in cases where $COCCI doesn't start with "./" characters, it doesn't remove the right part. Consider the following scenario: $ make coccicheck COCCI=scripts/coccinelle/api/drm-get-put.cocci \ MODE=patch M=drivers/staging V=1 where COCCI=scripts/coccinelle/api/drm-get-put.cocci and srctree=. In this case, out pattern matches the first "s/", and we end up assigning "scriptcoccinelle/api/drm-get-put.cocci" to $FILE. Fix this by adding a caret ^ at the beginning of regex pattern, so that it matches only start of the path. Signed-off-by: Cihangir AkturkAcked-by: nicolas.pa...@univ-grenoble-alpes.fr --- > scripts/coccicheck | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/coccicheck b/scripts/coccicheck index ec487b8..8de4245 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -193,7 +193,7 @@ coccinelle () { if [ $VERBOSE -ne 0 -a $ONLINE -eq 0 ] ; then - FILE=`echo $COCCI | sed "s|$srctree/||"` + FILE=`echo $COCCI | sed "s|^$srctree/||"` echo "Processing `basename $COCCI`" echo "with option(s) \"$OPT\"" -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME
Re: [PATCH] coccicheck: improve pattern for getting relative path
Le 10/08/17 à 19:40, Cihangir Akturk a écrit : When invoked with V=1, coccicheck script prints the information about which semantic patch (*.cocci file) used for this operation. Actually, it prints out the relative path of the related semantic patch. The script uses sed to remove the source tree part from cocci file path like so: FILE=`echo $COCCI | sed "s|$srctree/||"` This pattern works well most of the time. But in cases where $COCCI doesn't start with "./" characters, it doesn't remove the right part. Consider the following scenario: $ make coccicheck COCCI=scripts/coccinelle/api/drm-get-put.cocci \ MODE=patch M=drivers/staging V=1 where COCCI=scripts/coccinelle/api/drm-get-put.cocci and srctree=. In this case, out pattern matches the first "s/", and we end up assigning "scriptcoccinelle/api/drm-get-put.cocci" to $FILE. Fix this by adding a caret ^ at the beginning of regex pattern, so that it matches only start of the path. Signed-off-by: Cihangir Akturk Acked-by: nicolas.pa...@univ-grenoble-alpes.fr --- > scripts/coccicheck | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/coccicheck b/scripts/coccicheck index ec487b8..8de4245 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -193,7 +193,7 @@ coccinelle () { if [ $VERBOSE -ne 0 -a $ONLINE -eq 0 ] ; then - FILE=`echo $COCCI | sed "s|$srctree/||"` + FILE=`echo $COCCI | sed "s|^$srctree/||"` echo "Processing `basename $COCCI`" echo "with option(s) \"$OPT\"" -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME
Re: [PATCH 02/10] docs: sphinxify coccinelle.txt and add it to dev-tools
Le 09/08/16 à 01:34, Jonathan Corbet a écrit : No textual changes have been made, but the formatting has obviously been tweaked. Cc: Michal MarekCc: Gilles Muller Cc: Nicolas Palix Cc: Julia Lawall Signed-off-by: Jonathan Corbet Acked-by: Nicolas Palix --- .../{coccinelle.txt => dev-tools/coccinelle.rst} | 359 +++-- Documentation/dev-tools/tools.rst | 1 + MAINTAINERS| 2 +- 3 files changed, 192 insertions(+), 170 deletions(-) rename Documentation/{coccinelle.txt => dev-tools/coccinelle.rst} (56%) diff --git a/Documentation/coccinelle.txt b/Documentation/dev-tools/coccinelle.rst similarity index 56% rename from Documentation/coccinelle.txt rename to Documentation/dev-tools/coccinelle.rst index 01fb1da..4a64b4c 100644 --- a/Documentation/coccinelle.txt +++ b/Documentation/dev-tools/coccinelle.rst @@ -1,10 +1,18 @@ -Copyright 2010 Nicolas Palix -Copyright 2010 Julia Lawall -Copyright 2010 Gilles Muller +.. Copyright 2010 Nicolas Palix +.. Copyright 2010 Julia Lawall +.. Copyright 2010 Gilles Muller +.. highlight:: none - Getting Coccinelle - +Coccinelle +== + +Coccinelle is a tool for pattern matching and text transformation that has +many uses in kernel development, including the application of complex, +tree-wide patches and detection of problematic programming patterns. + +Getting Coccinelle +--- The semantic patches included in the kernel use features and options which are provided by Coccinelle version 1.0.0-rc11 and above. @@ -22,24 +30,23 @@ of many distributions, e.g. : - NetBSD - FreeBSD - 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: +Once you have it, run the following command:: ./configure make -as a regular user, and install it with +as a regular user, and install it with:: sudo make install - Supplemental documentation - +Supplemental documentation +--- For supplemental documentation refer to the wiki: @@ -47,49 +54,52 @@ https://bottest.wiki.kernel.org/coccicheck The wiki documentation always refers to the linux-next version of the script. - Using Coccinelle on the Linux kernel -~~ +Using Coccinelle on the Linux kernel + 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. +Makefile. This target is named ``coccicheck`` and calls the ``coccicheck`` +front-end in the ``scripts`` directory. -Four basic modes are defined: patch, report, context, and org. The mode to -use is specified by setting the MODE variable with 'MODE='. +Four basic modes are defined: ``patch``, ``report``, ``context``, and +``org``. The mode to use is specified by setting the MODE variable with +``MODE=``. -'patch' proposes a fix, when possible. +- ``patch`` proposes a fix, when possible. -'report' generates a list in the following format: +- ``report`` generates a list in the following format: file:line:column-column: message -'context' highlights lines of interest and their context in a -diff-like style.Lines of interest are indicated with '-'. +- ``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. +- ``org`` generates a report in the Org mode format of Emacs. Note that not all semantic patches implement all modes. For easy use of Coccinelle, the default mode is "report". Two other modes provide some common combinations of these modes. -'chain' tries the previous modes in the order above until one succeeds. +- ``chain`` tries the previous modes in the order above until one succeeds. + +- ``rep+ctxt`` runs successively the report mode and the context mode. + It should be used with the C option (described later) + which checks the code on a file basis. -'rep+ctxt' runs successively the report mode and the context mode. - It should be used with the C option (described later) - which checks the code on a file basis. +Examples + -Examples: - To make a report for every semantic patch, run the following command: +To make a report for every semantic patch, run the following command:: make coccicheck MODE=report - To produce patches, run: +To produce
Re: [PATCH 02/10] docs: sphinxify coccinelle.txt and add it to dev-tools
Le 09/08/16 à 01:34, Jonathan Corbet a écrit : No textual changes have been made, but the formatting has obviously been tweaked. Cc: Michal Marek Cc: Gilles Muller Cc: Nicolas Palix Cc: Julia Lawall Signed-off-by: Jonathan Corbet Acked-by: Nicolas Palix --- .../{coccinelle.txt => dev-tools/coccinelle.rst} | 359 +++-- Documentation/dev-tools/tools.rst | 1 + MAINTAINERS| 2 +- 3 files changed, 192 insertions(+), 170 deletions(-) rename Documentation/{coccinelle.txt => dev-tools/coccinelle.rst} (56%) diff --git a/Documentation/coccinelle.txt b/Documentation/dev-tools/coccinelle.rst similarity index 56% rename from Documentation/coccinelle.txt rename to Documentation/dev-tools/coccinelle.rst index 01fb1da..4a64b4c 100644 --- a/Documentation/coccinelle.txt +++ b/Documentation/dev-tools/coccinelle.rst @@ -1,10 +1,18 @@ -Copyright 2010 Nicolas Palix -Copyright 2010 Julia Lawall -Copyright 2010 Gilles Muller +.. Copyright 2010 Nicolas Palix +.. Copyright 2010 Julia Lawall +.. Copyright 2010 Gilles Muller +.. highlight:: none - Getting Coccinelle - +Coccinelle +== + +Coccinelle is a tool for pattern matching and text transformation that has +many uses in kernel development, including the application of complex, +tree-wide patches and detection of problematic programming patterns. + +Getting Coccinelle +--- The semantic patches included in the kernel use features and options which are provided by Coccinelle version 1.0.0-rc11 and above. @@ -22,24 +30,23 @@ of many distributions, e.g. : - NetBSD - FreeBSD - 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: +Once you have it, run the following command:: ./configure make -as a regular user, and install it with +as a regular user, and install it with:: sudo make install - Supplemental documentation - +Supplemental documentation +--- For supplemental documentation refer to the wiki: @@ -47,49 +54,52 @@ https://bottest.wiki.kernel.org/coccicheck The wiki documentation always refers to the linux-next version of the script. - Using Coccinelle on the Linux kernel -~~ +Using Coccinelle on the Linux kernel + 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. +Makefile. This target is named ``coccicheck`` and calls the ``coccicheck`` +front-end in the ``scripts`` directory. -Four basic modes are defined: patch, report, context, and org. The mode to -use is specified by setting the MODE variable with 'MODE='. +Four basic modes are defined: ``patch``, ``report``, ``context``, and +``org``. The mode to use is specified by setting the MODE variable with +``MODE=``. -'patch' proposes a fix, when possible. +- ``patch`` proposes a fix, when possible. -'report' generates a list in the following format: +- ``report`` generates a list in the following format: file:line:column-column: message -'context' highlights lines of interest and their context in a -diff-like style.Lines of interest are indicated with '-'. +- ``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. +- ``org`` generates a report in the Org mode format of Emacs. Note that not all semantic patches implement all modes. For easy use of Coccinelle, the default mode is "report". Two other modes provide some common combinations of these modes. -'chain' tries the previous modes in the order above until one succeeds. +- ``chain`` tries the previous modes in the order above until one succeeds. + +- ``rep+ctxt`` runs successively the report mode and the context mode. + It should be used with the C option (described later) + which checks the code on a file basis. -'rep+ctxt' runs successively the report mode and the context mode. - It should be used with the C option (described later) - which checks the code on a file basis. +Examples + -Examples: - To make a report for every semantic patch, run the following command: +To make a report for every semantic patch, run the following command:: make coccicheck MODE=report - To produce patches, run: +To produce patches, run:: make coccicheck MODE=patch The coccicheck target applies every semantic patch available in the -sub-directories of 'scripts/coccinelle' to the entire Linux kernel. +sub-directories of
Re: [PATCH v3 2/8] coccicheck: make SPFLAGS more useful
Le 21/06/16 à 21:21, Luis R. Rodriguez a écrit : SPFLAGS is set early, it means that any heuristics done on coccicheck cannot be overridden currently. Move SPFLAGS after OPTIONS and set this at the end. This lets you override any heuristics as coccinelle treats conflicts by only listening to the last option that makes sense. Signed-off-by: Luis R. RodriguezAcked-by: Nicolas Palix --- scripts/coccicheck | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/coccicheck b/scripts/coccicheck index f137b04dfdd3..5319fae910b4 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -30,7 +30,7 @@ else NPROC="$J" fi -FLAGS="--very-quiet $SPFLAGS" +FLAGS="--very-quiet" # spatch only allows include directories with the syntax "-I include" # while gcc also allows "-Iinclude" and "-include include" @@ -106,6 +106,9 @@ kill_running() { done } +# You can override heuristics with SPFLAGS, these must always go last +OPTIONS="$OPTIONS $SPFLAGS" + coccinelle () { COCCI="$1" -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME
Re: [PATCH v3 2/8] coccicheck: make SPFLAGS more useful
Le 21/06/16 à 21:21, Luis R. Rodriguez a écrit : SPFLAGS is set early, it means that any heuristics done on coccicheck cannot be overridden currently. Move SPFLAGS after OPTIONS and set this at the end. This lets you override any heuristics as coccinelle treats conflicts by only listening to the last option that makes sense. Signed-off-by: Luis R. Rodriguez Acked-by: Nicolas Palix --- scripts/coccicheck | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/coccicheck b/scripts/coccicheck index f137b04dfdd3..5319fae910b4 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -30,7 +30,7 @@ else NPROC="$J" fi -FLAGS="--very-quiet $SPFLAGS" +FLAGS="--very-quiet" # spatch only allows include directories with the syntax "-I include" # while gcc also allows "-Iinclude" and "-include include" @@ -106,6 +106,9 @@ kill_running() { done } +# You can override heuristics with SPFLAGS, these must always go last +OPTIONS="$OPTIONS $SPFLAGS" + coccinelle () { COCCI="$1" -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME
Re: [PATCH v3 8/8] scripts/coccinelle: require coccinelle >= 1.0.4 on device_node_continue.cocci
Le 21/06/16 à 22:36, Julia Lawall a écrit : On Tue, 21 Jun 2016, Luis R. Rodriguez wrote: Make use of the new Requires: tag to be able to specify coccinelle binary version requirements. The cocci file device_node_continue.cocci requires at least coccinelle 1.0.4. Signed-off-by: Luis R. RodriguezAcked-by: Julia Lawall Acked-by: Nicolas Palix --- scripts/coccinelle/iterators/device_node_continue.cocci | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/coccinelle/iterators/device_node_continue.cocci b/scripts/coccinelle/iterators/device_node_continue.cocci index 38ab744a4037..a36c16db171b 100644 --- a/scripts/coccinelle/iterators/device_node_continue.cocci +++ b/scripts/coccinelle/iterators/device_node_continue.cocci @@ -5,8 +5,11 @@ // Copyright: (C) 2015 Julia Lawall, Inria. GPLv2. // URL: http://coccinelle.lip6.fr/ // Options: --no-includes --include-headers +// Requires: 1.0.4 // Keywords: for_each_child_of_node, etc. +// This uses a conjunction, which requires at least coccinelle >= 1.0.4 + virtual patch virtual context virtual org -- 2.8.2 -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME
Re: [PATCH v3 8/8] scripts/coccinelle: require coccinelle >= 1.0.4 on device_node_continue.cocci
Le 21/06/16 à 22:36, Julia Lawall a écrit : On Tue, 21 Jun 2016, Luis R. Rodriguez wrote: Make use of the new Requires: tag to be able to specify coccinelle binary version requirements. The cocci file device_node_continue.cocci requires at least coccinelle 1.0.4. Signed-off-by: Luis R. Rodriguez Acked-by: Julia Lawall Acked-by: Nicolas Palix --- scripts/coccinelle/iterators/device_node_continue.cocci | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/coccinelle/iterators/device_node_continue.cocci b/scripts/coccinelle/iterators/device_node_continue.cocci index 38ab744a4037..a36c16db171b 100644 --- a/scripts/coccinelle/iterators/device_node_continue.cocci +++ b/scripts/coccinelle/iterators/device_node_continue.cocci @@ -5,8 +5,11 @@ // Copyright: (C) 2015 Julia Lawall, Inria. GPLv2. // URL: http://coccinelle.lip6.fr/ // Options: --no-includes --include-headers +// Requires: 1.0.4 // Keywords: for_each_child_of_node, etc. +// This uses a conjunction, which requires at least coccinelle >= 1.0.4 + virtual patch virtual context virtual org -- 2.8.2 -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME
Re: [PATCH v3 6/8] coccicheck: add support for requring a coccinelle version
Le 21/06/16 à 21:21, Luis R. Rodriguez a écrit : Enable Coccinelle SmPL patches to require a specific version of Coccinelle. In the event that the version does not match we just inform the user, if the user asked to go through all SmPL patches we just inform them of the need for a new version of coccinelle for the SmPL patch and continue on with the rest. This uses the simple kernel scripts/ld-version.sh to create a weight on the version provided by spatch. The -dirty attribute is ignored if supplied, the benefit of scripts/ld-version.sh is it has a long history and well tested. Signed-off-by: Luis R. RodriguezAcked-by: Nicolas Palix --- scripts/coccicheck | 14 ++ 1 file changed, 14 insertions(+) diff --git a/scripts/coccicheck b/scripts/coccicheck index 998d764636e0..01b6716ea931 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -5,6 +5,7 @@ # version 1.0.0-rc11. # +DIR="$(dirname $(readlink -f $0))/.." SPATCH="`which ${SPATCH:=spatch}`" if [ ! -x "$SPATCH" ]; then @@ -12,6 +13,9 @@ if [ ! -x "$SPATCH" ]; then exit 1 fi +SPATCH_VERSION=$($SPATCH --version | head -1 | awk '{print $3}') +SPATCH_VERSION_NUM=$(echo $SPATCH_VERSION | ${DIR}/scripts/ld-version.sh) + USE_JOBS="no" $SPATCH --help | grep "\-\-jobs" > /dev/null && USE_JOBS="yes" @@ -171,6 +175,16 @@ coccinelle () { COCCI="$1" OPT=`grep "Option" $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 + echo "Skipping coccinele SmPL patch: $COCCI" + echo "You have coccinelle: $SPATCH_VERSION" + echo "This SmPL patch requires: $REQ" + return + fi +fi # The option '--parse-cocci' can be used to syntactically check the SmPL files. # -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME
Re: [PATCH v3 6/8] coccicheck: add support for requring a coccinelle version
Le 21/06/16 à 21:21, Luis R. Rodriguez a écrit : Enable Coccinelle SmPL patches to require a specific version of Coccinelle. In the event that the version does not match we just inform the user, if the user asked to go through all SmPL patches we just inform them of the need for a new version of coccinelle for the SmPL patch and continue on with the rest. This uses the simple kernel scripts/ld-version.sh to create a weight on the version provided by spatch. The -dirty attribute is ignored if supplied, the benefit of scripts/ld-version.sh is it has a long history and well tested. Signed-off-by: Luis R. Rodriguez Acked-by: Nicolas Palix --- scripts/coccicheck | 14 ++ 1 file changed, 14 insertions(+) diff --git a/scripts/coccicheck b/scripts/coccicheck index 998d764636e0..01b6716ea931 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -5,6 +5,7 @@ # version 1.0.0-rc11. # +DIR="$(dirname $(readlink -f $0))/.." SPATCH="`which ${SPATCH:=spatch}`" if [ ! -x "$SPATCH" ]; then @@ -12,6 +13,9 @@ if [ ! -x "$SPATCH" ]; then exit 1 fi +SPATCH_VERSION=$($SPATCH --version | head -1 | awk '{print $3}') +SPATCH_VERSION_NUM=$(echo $SPATCH_VERSION | ${DIR}/scripts/ld-version.sh) + USE_JOBS="no" $SPATCH --help | grep "\-\-jobs" > /dev/null && USE_JOBS="yes" @@ -171,6 +175,16 @@ coccinelle () { COCCI="$1" OPT=`grep "Option" $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 + echo "Skipping coccinele SmPL patch: $COCCI" + echo "You have coccinelle: $SPATCH_VERSION" + echo "This SmPL patch requires: $REQ" + return + fi +fi # The option '--parse-cocci' can be used to syntactically check the SmPL files. # -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME
Re: [PATCH v3 7/8] coccicheck: refer to coccicheck bottest wiki for documentation
Hi, Le 21/06/16 à 21:21, Luis R. Rodriguez a écrit : Sprinkling *tons* of documentation on the script is not a good idea, instead refer to a wiki for further coccicheck documentation: https://bottest.wiki.kernel.org/coccicheck This page shall always refer to the linux-next iteration of scripts/coccicheck. Can you say a word about Documentation/coccinelle.txt too ? And update it according to the script changes. Signed-off-by: Luis R. Rodriguez--- scripts/coccicheck | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/coccicheck b/scripts/coccicheck index 01b6716ea931..adbcbbd1aad6 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -1,9 +1,14 @@ #!/bin/bash - +# Linux kernel coccicheck +# +# For more detailed documentation refer to: +# +# https://bottest.wiki.kernel.org/coccicheck +# +# This documentation always refers to the linux-next version of the script. # # This script requires at least spatch # version 1.0.0-rc11. -# DIR="$(dirname $(readlink -f $0))/.." SPATCH="`which ${SPATCH:=spatch}`" -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME
Re: [PATCH v3 7/8] coccicheck: refer to coccicheck bottest wiki for documentation
Hi, Le 21/06/16 à 21:21, Luis R. Rodriguez a écrit : Sprinkling *tons* of documentation on the script is not a good idea, instead refer to a wiki for further coccicheck documentation: https://bottest.wiki.kernel.org/coccicheck This page shall always refer to the linux-next iteration of scripts/coccicheck. Can you say a word about Documentation/coccinelle.txt too ? And update it according to the script changes. Signed-off-by: Luis R. Rodriguez --- scripts/coccicheck | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/coccicheck b/scripts/coccicheck index 01b6716ea931..adbcbbd1aad6 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -1,9 +1,14 @@ #!/bin/bash - +# Linux kernel coccicheck +# +# For more detailed documentation refer to: +# +# https://bottest.wiki.kernel.org/coccicheck +# +# This documentation always refers to the linux-next version of the script. # # This script requires at least spatch # version 1.0.0-rc11. -# DIR="$(dirname $(readlink -f $0))/.." SPATCH="`which ${SPATCH:=spatch}`" -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME
Re: [PATCH v3 5/8] scripts: add Linux .cocciconfig for coccinelle
Le 21/06/16 à 21:21, Luis R. Rodriguez a écrit : Help Coccinelle when used against Linux with a set of sensible defaults options for Linux. This hints to coccinelle git can be used for 'git grep' queries over coccigrep. A timeout of 200 seconds should suffice for now. If you use idutils you can override for 'make coccicheck' by using the SPFLAGS option as follows: First build the index, for example: mkid -s Pick the cocci file you wnat to work with: export COCCI=scripts/coccinelle/misc/irqf_oneshot.cocci Then run coccicheck: $ make coccicheck V=1 MODE=report SPFLAGS="--use-idutils ID" Coccinelle supports reading .cocciconfig from different directories, the later one overriding the previous reads in the following order: o Your current user's home directory is processed first o Your directory from which spatch is called is processed next o The directory provided with the --dir option is processed last, if used Signed-off-by: Luis R. RodriguezAcked-by: Nicolas Palix --- .cocciconfig | 3 +++ .gitignore | 1 + 2 files changed, 4 insertions(+) create mode 100644 .cocciconfig diff --git a/.cocciconfig b/.cocciconfig new file mode 100644 index ..43967c6b2015 --- /dev/null +++ b/.cocciconfig @@ -0,0 +1,3 @@ +[spatch] + options = --timeout 200 + options = --use-gitgrep diff --git a/.gitignore b/.gitignore index 2be25f771bd8..c2ed4ecb0acd 100644 --- a/.gitignore +++ b/.gitignore @@ -67,6 +67,7 @@ Module.symvers # !.gitignore !.mailmap +!.cocciconfig # # Generated include files -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME
Re: [PATCH v3 5/8] scripts: add Linux .cocciconfig for coccinelle
Le 21/06/16 à 21:21, Luis R. Rodriguez a écrit : Help Coccinelle when used against Linux with a set of sensible defaults options for Linux. This hints to coccinelle git can be used for 'git grep' queries over coccigrep. A timeout of 200 seconds should suffice for now. If you use idutils you can override for 'make coccicheck' by using the SPFLAGS option as follows: First build the index, for example: mkid -s Pick the cocci file you wnat to work with: export COCCI=scripts/coccinelle/misc/irqf_oneshot.cocci Then run coccicheck: $ make coccicheck V=1 MODE=report SPFLAGS="--use-idutils ID" Coccinelle supports reading .cocciconfig from different directories, the later one overriding the previous reads in the following order: o Your current user's home directory is processed first o Your directory from which spatch is called is processed next o The directory provided with the --dir option is processed last, if used Signed-off-by: Luis R. Rodriguez Acked-by: Nicolas Palix --- .cocciconfig | 3 +++ .gitignore | 1 + 2 files changed, 4 insertions(+) create mode 100644 .cocciconfig diff --git a/.cocciconfig b/.cocciconfig new file mode 100644 index ..43967c6b2015 --- /dev/null +++ b/.cocciconfig @@ -0,0 +1,3 @@ +[spatch] + options = --timeout 200 + options = --use-gitgrep diff --git a/.gitignore b/.gitignore index 2be25f771bd8..c2ed4ecb0acd 100644 --- a/.gitignore +++ b/.gitignore @@ -67,6 +67,7 @@ Module.symvers # !.gitignore !.mailmap +!.cocciconfig # # Generated include files -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME
Re: [PATCH v3 3/8] coccicheck: enable parmap support
Hi, Le 21/06/16 à 22:43, Julia Lawall a écrit : On Tue, 21 Jun 2016, Luis R. Rodriguez wrote: On Tue, Jun 21, 2016 at 10:17:38PM +0200, Julia Lawall wrote: On Tue, 21 Jun 2016, Luis R. Rodriguez wrote: Coccinelle has had parmap support since 1.0.2, this means it supports --jobs, enabling built-in multithreaded functionality, instead of needing one to script it out. Just look for --jobs in the help output to determine if this is supported. Also enable the load balancing to be dynamic, so that if a thread finishes early we keep feeding it. Note: now that we have all things handled for us, redirect stderr to stdout as well to capture any possible errors or warnings issued by coccinelle. If --jobs is not supported we fallback to the old mechanism. This also now accepts DEBUG_FILE= to specify where you want stderr to be redirected to, by default we redirect stderr to /dev/null. Why do you want to do something different for standard error in the parmap and nonparmap case? We should just deprecate non-parmap later. that's not really getting at the point. I like the DEBUG_FILE= solution. I don't like merging stderr and stdout. So you've put what to my mind is the good solution only in the deprecated case (to my understanding of the commit message). I agree. You're not just "enabling parmap support". You're also changing how messages to stderr are handled. Maybe add the DEBUG_FILE mechanism in a separate patch for both modes (parmap and non-parmap). julia -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME
Re: [PATCH v3 3/8] coccicheck: enable parmap support
Hi, Le 21/06/16 à 22:43, Julia Lawall a écrit : On Tue, 21 Jun 2016, Luis R. Rodriguez wrote: On Tue, Jun 21, 2016 at 10:17:38PM +0200, Julia Lawall wrote: On Tue, 21 Jun 2016, Luis R. Rodriguez wrote: Coccinelle has had parmap support since 1.0.2, this means it supports --jobs, enabling built-in multithreaded functionality, instead of needing one to script it out. Just look for --jobs in the help output to determine if this is supported. Also enable the load balancing to be dynamic, so that if a thread finishes early we keep feeding it. Note: now that we have all things handled for us, redirect stderr to stdout as well to capture any possible errors or warnings issued by coccinelle. If --jobs is not supported we fallback to the old mechanism. This also now accepts DEBUG_FILE= to specify where you want stderr to be redirected to, by default we redirect stderr to /dev/null. Why do you want to do something different for standard error in the parmap and nonparmap case? We should just deprecate non-parmap later. that's not really getting at the point. I like the DEBUG_FILE= solution. I don't like merging stderr and stdout. So you've put what to my mind is the good solution only in the deprecated case (to my understanding of the commit message). I agree. You're not just "enabling parmap support". You're also changing how messages to stderr are handled. Maybe add the DEBUG_FILE mechanism in a separate patch for both modes (parmap and non-parmap). julia -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME
Re: [PATCH v3 1/8] coccicheck: move spatch binary check up
Le 21/06/16 à 21:21, Luis R. Rodriguez a écrit : This has no functional changes. This is being done to enable us to later use spatch binary for some flag checking for certain features early on. Signed-off-by: Luis R. RodriguezAcked-by: Nicolas Palix --- scripts/coccicheck | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/coccicheck b/scripts/coccicheck index f6627863fdc3..f137b04dfdd3 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -7,6 +7,11 @@ SPATCH="`which ${SPATCH:=spatch}`" +if [ ! -x "$SPATCH" ]; then +echo 'spatch is part of the Coccinelle project and is available at http://coccinelle.lip6.fr/' +exit 1 +fi + trap kill_running SIGTERM SIGINT declare -a SPATCH_PID @@ -51,11 +56,6 @@ if [ "$KBUILD_EXTMOD" != "" ] ; then OPTIONS="--patch $srctree $OPTIONS" fi -if [ ! -x "$SPATCH" ]; then -echo 'spatch is part of the Coccinelle project and is available at http://coccinelle.lip6.fr/' -exit 1 -fi - if [ "$MODE" = "" ] ; then if [ "$ONLINE" = "0" ] ; then echo 'You have not explicitly specified the mode to use. Using default "report" mode.' -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME
Re: [PATCH v3 1/8] coccicheck: move spatch binary check up
Le 21/06/16 à 21:21, Luis R. Rodriguez a écrit : This has no functional changes. This is being done to enable us to later use spatch binary for some flag checking for certain features early on. Signed-off-by: Luis R. Rodriguez Acked-by: Nicolas Palix --- scripts/coccicheck | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/coccicheck b/scripts/coccicheck index f6627863fdc3..f137b04dfdd3 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -7,6 +7,11 @@ SPATCH="`which ${SPATCH:=spatch}`" +if [ ! -x "$SPATCH" ]; then +echo 'spatch is part of the Coccinelle project and is available at http://coccinelle.lip6.fr/' +exit 1 +fi + trap kill_running SIGTERM SIGINT declare -a SPATCH_PID @@ -51,11 +56,6 @@ if [ "$KBUILD_EXTMOD" != "" ] ; then OPTIONS="--patch $srctree $OPTIONS" fi -if [ ! -x "$SPATCH" ]; then -echo 'spatch is part of the Coccinelle project and is available at http://coccinelle.lip6.fr/' -exit 1 -fi - if [ "$MODE" = "" ] ; then if [ "$ONLINE" = "0" ] ; then echo 'You have not explicitly specified the mode to use. Using default "report" mode.' -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME
Re: [PATCH] coccicheck: Allow for overriding spatch flags
Le 12/06/16 à 21:04, Deepa Dinamani a écrit : Documentation/coccinelle.txt suggests using the SPFLAGS make variable to pass additional options to spatch. Reorder the way SPFLAGS is added to FLAGS, to allow for options in the SPFLAGS to override the default --very-quiet option. Similarly, rearrage the FLAGS for org or report mode. This allows for overriding of the default --no-show-diff option through SPFLAGS. Signed-off-by: Deepa DinamaniCc: Julia Lawall Cc: Gilles Muller Cc: Nicolas Palix Acked-By: Nicolas Palix Cc: Michal Marek --- scripts/coccicheck | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/coccicheck b/scripts/coccicheck index dd85a45..f662786 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -25,7 +25,7 @@ else NPROC="$J" fi -FLAGS="$SPFLAGS --very-quiet" +FLAGS="--very-quiet $SPFLAGS" # spatch only allows include directories with the syntax "-I include" # while gcc also allows "-Iinclude" and "-include include" @@ -72,7 +72,7 @@ if [ "$MODE" = "chain" ] ; then echo 'All available modes will be tried (in that order): patch, report, context, org' fi elif [ "$MODE" = "report" -o "$MODE" = "org" ] ; then -FLAGS="$FLAGS --no-show-diff" +FLAGS="--no-show-diff $FLAGS" fi if [ "$ONLINE" = "0" ] ; then -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME
Re: [PATCH] coccicheck: Allow for overriding spatch flags
Le 12/06/16 à 21:04, Deepa Dinamani a écrit : Documentation/coccinelle.txt suggests using the SPFLAGS make variable to pass additional options to spatch. Reorder the way SPFLAGS is added to FLAGS, to allow for options in the SPFLAGS to override the default --very-quiet option. Similarly, rearrage the FLAGS for org or report mode. This allows for overriding of the default --no-show-diff option through SPFLAGS. Signed-off-by: Deepa Dinamani Cc: Julia Lawall Cc: Gilles Muller Cc: Nicolas Palix Acked-By: Nicolas Palix Cc: Michal Marek --- scripts/coccicheck | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/coccicheck b/scripts/coccicheck index dd85a45..f662786 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -25,7 +25,7 @@ else NPROC="$J" fi -FLAGS="$SPFLAGS --very-quiet" +FLAGS="--very-quiet $SPFLAGS" # spatch only allows include directories with the syntax "-I include" # while gcc also allows "-Iinclude" and "-include include" @@ -72,7 +72,7 @@ if [ "$MODE" = "chain" ] ; then echo 'All available modes will be tried (in that order): patch, report, context, org' fi elif [ "$MODE" = "report" -o "$MODE" = "org" ] ; then -FLAGS="$FLAGS --no-show-diff" +FLAGS="--no-show-diff $FLAGS" fi if [ "$ONLINE" = "0" ] ; then -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME
Re: [PATCH] coccicheck: Fix missing 0 index in kill loop
Le 16/05/16 14:55, Kees Cook a écrit : > By default, "seq" counts from 1, but processes were starting counting > from 0, so when interrupted, coccicheck would leave the 0th process > running. > > Signed-off-by: Kees CookAcked-by: Nicolas Palix > --- > scripts/coccicheck | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/coccicheck b/scripts/coccicheck > index b2d758188f2f..dd85a455b2ba 100755 > --- a/scripts/coccicheck > +++ b/scripts/coccicheck > @@ -98,7 +98,7 @@ run_cmd() { > } > > kill_running() { > - for i in $(seq $(( NPROC - 1 )) ); do > + for i in $(seq 0 $(( NPROC - 1 )) ); do > if [ $VERBOSE -eq 2 ] ; then > echo "Killing ${SPATCH_PID[$i]}" > fi > -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME
Re: [PATCH] coccicheck: Fix missing 0 index in kill loop
Le 16/05/16 14:55, Kees Cook a écrit : > By default, "seq" counts from 1, but processes were starting counting > from 0, so when interrupted, coccicheck would leave the 0th process > running. > > Signed-off-by: Kees Cook Acked-by: Nicolas Palix > --- > scripts/coccicheck | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/coccicheck b/scripts/coccicheck > index b2d758188f2f..dd85a455b2ba 100755 > --- a/scripts/coccicheck > +++ b/scripts/coccicheck > @@ -98,7 +98,7 @@ run_cmd() { > } > > kill_running() { > - for i in $(seq $(( NPROC - 1 )) ); do > + for i in $(seq 0 $(( NPROC - 1 )) ); do > if [ $VERBOSE -eq 2 ] ; then > echo "Killing ${SPATCH_PID[$i]}" > fi > -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME