Re: [Cocci] [PATCH v2] Coccinelle: Add misc/boolconv.cocci

2016-12-10 Thread Michal Marek
On Mon, Oct 17, 2016 at 11:52:24AM -0500, Andrew F. Davis wrote: > Add a script to check for unneeded conversions to bool. > > Signed-off-by: Andrew F. Davis > Acked-by: Julia Lawall Applied to kbuild.git#misc, thanks. Michal

Re: [Cocci] [PATCH] Coccinelle: flag conditions with no effect

2016-10-11 Thread Michal Marek
On Sat, Oct 08, 2016 at 05:51:45PM +0200, Nicholas Mc Guire wrote: > Report code constructs where the if and else branch are functionally > identical. In cases where this is intended it really should be > documented - most reported cases probably are bugs. > > Signed-off-by: Nicholas Mc Guire

Re: [Cocci] [PATCH] Coccinelle: pm_runtime: ensure relevance of pm_runtime reports

2016-10-01 Thread Michal Marek
Dne 22.9.2016 v 10:28 Julia Lawall napsal(a): > pm_runtime.cocci starts with one rule that searches for a variety of > functions calls, followed by various rules that report errors. Previously, > the only connection between the first rule and the rest was to check that > the first rule had

Re: [Cocci] [PATCH] Coccinelle: limit memdup_user transformation to GFP_KERNEL case

2016-10-01 Thread Michal Marek
Dne 21.9.2016 v 17:48 Julia Lawall napsal(a): > Memdup_user encapsulates a memory allocation with the flag GFP_KERNEL, so > only allow this flag in the original code. > > Signed-off-by: Julia Lawall Applied to kbuild.git#misc. Thanks, Michal

Re: [Cocci] [PATCH] Coccinelle: Script to replace allocate and memcpy with zalloc functions

2016-07-26 Thread Michal Marek
Dne 23.7.2016 v 23:00 Amitoj Kaur Chawla napsal(a): > This script finds instances of allocate and memcpy which can be > replaced with a direct call to zalloc equivalent of a function. > > Signed-off-by: Amitoj Kaur Chawla > --- > scripts/coccinelle/api/zalloc.cocci | 556

Re: [Cocci] [PATCH v4 0/9] coccicheck: modernize

2016-07-22 Thread Michal Marek
On 2016-07-13 23:45, Luis R. Rodriguez wrote: > On Wed, Jun 29, 2016 at 03:14:50PM -0700, Luis R. Rodriguez wrote: >> There were quite a bit of comments from the v3 series [0], since there >> was quite a bit of review needed for some other changes I've had discussions >> with Nicolas and Julia

Re: [Cocci] [PATCH v2 1/3] coccinelle: also catch kzfree() issues

2016-06-21 Thread Michal Marek
Dne 20.6.2016 v 22:21 Julia Lawall napsal(a): > > > On Mon, 20 Jun 2016, Michal Marek wrote: > >> On 2016-05-23 17:18, Julia Lawall wrote: >>> >>> >>> On Mon, 23 May 2016, Yann Droneaud wrote: >>> >>>> Since commit 3ef0e5ba4

Re: [Cocci] [PATCH v3] Coccinelle: noderef: Add new rules and correct the old rule

2016-06-20 Thread Michal Marek
On 2016-05-24 10:39, Julia Lawall wrote: > Acked-by: Julia Lawall > > On Tue, 24 May 2016, Vaishali Thakkar wrote: > >> Add new rules to detect the cases where sizeof is used in >> function calls as a argument. >> >> Also, for the patch mode third rule should behave same

Re: [Cocci] [PATCH 2/4] scripts: add reqs python library

2016-06-15 Thread Michal Marek
Dne 15.6.2016 v 18:02 Luis R. Rodriguez napsal(a): > On Wed, Jun 15, 2016 at 09:50:11AM +0200, Michal Marek wrote: >> On 2016-06-15 00:10, Luis R. Rodriguez wrote: >>> +weight = (int(rel_specs['VERSION'])<< 32) + \ >>> + (i

Re: [Cocci] [PATCH 3/4] coccicheck: enable use of the kernel's python library

2016-06-15 Thread Michal Marek
On 2016-06-15 00:10, Luis R. Rodriguez wrote: > Signed-off-by: Luis R. Rodriguez > --- > scripts/coccicheck | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/scripts/coccicheck b/scripts/coccicheck > index ba7301ab0a3d..a4d91d649ad9 100755 > --- a/scripts/coccicheck

Re: [Cocci] [PATCH 2/4] scripts: add reqs python library

2016-06-15 Thread Michal Marek
On 2016-06-15 00:10, Luis R. Rodriguez wrote: > +weight = (int(rel_specs['VERSION'])<< 32) + \ > + (int(rel_specs['PATCHLEVEL']) << 16) + \ > + (sublevel << 8 ) + \ > + (extra * 60) + (relmod * 2) This is going

Re: [Cocci] [PATCH] scripts: coccinelle: remove check to move constants to right

2016-04-20 Thread Michal Marek
On Sat, Mar 19, 2016 at 06:43:08PM +0100, Julia Lawall wrote: > On Sat, 19 Mar 2016, Wolfram Sang wrote: > > > The header mentions this check depends on personal taste. I agree. > > Running coccicheck on patches before I apply them, this SmPL produced > > enough false positives for me that I'd

Re: [Cocci] [PATCH] Coccinelle: setup_timer: Add space in front of parentheses

2016-04-20 Thread Michal Marek
Dne 20.3.2016 v 13:25 Julia Lawall napsal(a): > > > On Sun, 20 Mar 2016, Vaishali Thakkar wrote: > >> Add space in front of the offending parentheses to silent the >> parse error for older Coccinelle versions. This makes the rule >> usable with all Coccinelle versions. >> >> Reported-by:

Re: [Cocci] [PATCH] scripts/coccinelle: modernize

2016-02-19 Thread Michal Marek
On 2016-02-18 00:47, Nishanth Menon wrote: > On 02/17/2016 05:16 PM, Julia Lawall wrote: >> & is no longer allowed in column 0, since Coccinelle 1.0.4. >> >> Signed-off-by: Julia Lawall [...] > Verified with: > spatch --version > spatch byte-code version

Re: [Cocci] [PATCH] coccinelle: tests: improve odd_ptr_err.cocci

2015-10-26 Thread Michal Marek
Dne 30.8.2015 v 22:18 Julia Lawall napsal(a): > The original version only considered the case where the then branch > contains only one call to PTR_ERR. Reimplement the whole thing to allow > multiple calls, with potentially different arguments. > > Signed-off-by: Julia Lawall

Re: [Cocci] [PATCH] scripts/coccinelle: fix typos

2015-10-26 Thread Michal Marek
Dne 17.10.2015 v 11:35 Julia Lawall napsal(a): > Fix a couple spelling mistakes. > > Signed-off-by: Julia Lawall Applied, thanks. Michal ___ Cocci mailing list Cocci@systeme.lip6.fr

Re: [Cocci] [PATCH v2] Coccinelle: fix incorrect -include option transformation

2015-10-26 Thread Michal Marek
Dne 22.9.2015 v 15:27 Julia Lawall napsal(a): > On Tue, 22 Sep 2015, Andrzej Hajda wrote: > >> kbuild/gcc uses -include option to include files and -I to provide paths for >> #include <> directive. In case of spatch latter option should be prefixed >> with That hash sign in the comment was not

Re: [Cocci] [PATCH] cocinelle: iterators: semantic patch to delete unneeded of_node_put

2015-10-26 Thread Michal Marek
Dne 22.10.2015 v 22:11 Julia Lawall napsal(a): > Device node iterators perform an of_node_put on each iteration, so putting > an of_node_put before a continue results in a double put. > > Signed-off-by: Julia Lawall Applied to kbuild.git#misc, thanks. Michal

Re: [Cocci] [PATCH v6] coccinelle: Improve checking for missing NULL terminators

2015-10-26 Thread Michal Marek
Dne 23.10.2015 v 21:35 Julia Lawall napsal(a): > Acked-by: Julia Lawall > > On Fri, 23 Oct 2015, Daniel Granat wrote: > >> * Extend checking on tables containing structures which are >> initialized without specifying member name. Added new tables >> for checking:

Re: [Cocci] [PATCH 1/2] coccinelle: ifnullfree: improve and extend ifnullfree

2015-10-26 Thread Michal Marek
Dne 18.10.2015 v 11:55 SF Markus Elfring napsal(a): >> Remove removal and re-addition of freeing functions. > > I find such a wording confusing for a commit message. It is also a bit confusing to use the same subject for two patches in a series. How about [PATCH 1/2] coccinelle: ifnullfree:

Re: [Cocci] [PATCH 2/2 v2] coccinelle: ifnullfree: handle various destroy functions

2015-10-26 Thread Michal Marek
Dne 26.10.2015 v 22:28 Julia Lawall napsal(a): > Extend ifnullfree to the various destroy functions that were recently > extended to tolerate NULL arguments. > > Signed-off-by: Julia Lawall Applied both to kbuild.git#misc, thanks. Michal

Re: [Cocci] [PATCH] coccinelle: api: extend spatch for dropping unnecessary owner

2015-08-19 Thread Michal Marek
On 2015-07-10 06:53, Krzysztof Kozlowski wrote: i2c_add_driver (through i2c_register_driver) sets the owner field so we can drop it also from i2c drivers, just like from platform drivers. Signed-off-by: Krzysztof Kozlowski k.kozlow...@samsung.com Applied to kbuild.git#misc. Michal

Re: [Cocci] [RFC] coccinelle: add style check for assignment in if

2015-08-12 Thread Michal Marek
On 2015-08-12 16:53, Kris Borer wrote: On Wed, Aug 12, 2015 at 10:12 AM, Michal Marek mma...@suse.cz mailto:mma...@suse.cz wrote: On 2015-08-12 15:51, Kris Borer wrote: Add a semantic patch for fixing some cases of checkpatch.pl http://checkpatch.pl error: ERROR: do

Re: [Cocci] [RFC] coccinelle: add style check for assignment in if

2015-08-12 Thread Michal Marek
On 2015-08-12 15:51, Kris Borer wrote: Add a semantic patch for fixing some cases of checkpatch.pl error: ERROR: do not use assignment in if condition There is a gcc warning for this already. Michal ___ Cocci mailing list Cocci@systeme.lip6.fr

Re: [Cocci] [PATCH] coccinelle: simple_return: Add a blank line

2015-06-03 Thread Michal Marek
On Tue, Jun 02, 2015 at 07:18:07AM +0200, Julia Lawall wrote: On Mon, 1 Jun 2015, Fabio Estevam wrote: From: Fabio Estevam fabio.este...@freescale.com Insert a blank line in order to improve the readability of the generated patch and also make it consistent with the other .cocci

Re: [Cocci] [PATCH] coccinelle: irqf_oneshot.cocci: Improve the generated commit log

2015-05-25 Thread Michal Marek
Dne 25.5.2015 v 14:30 Valentin Rothberg napsal(a): On Mon, May 25, 2015 at 8:21 AM, Julia Lawall julia.law...@lip6.fr wrote: Valentin? (It's his semantic patch) julia On Sun, 24 May 2015, Fabio Estevam wrote: From: Fabio Estevam fabio.este...@freescale.com Improve the commit log of the

Re: [Cocci] [PATCH 2/2 RESEND] scripts/coccinelle/misc/irqf_oneshot.cocci: Fix grammar

2015-05-21 Thread Michal Marek
Dne 20.5.2015 v 19:02 Fabio Estevam napsal(a): From: Fabio Estevam fabio.este...@freescale.com Correct form is 'always requested'. Signed-off-by: Fabio Estevam fabio.este...@freescale.com Acked-by: Julia Lawall julia.law...@lip6.fr --- scripts/coccinelle/misc/irqf_oneshot.cocci | 2 +-

Re: [Cocci] [PATCHv2] coccinelle: api: add vma_pages.cocci

2015-05-21 Thread Michal Marek
Dne 18.5.2015 v 04:25 Julia Lawall napsal(a): On Sun, 17 May 2015, Dmitry Kalinkin wrote: This semantic patch replaces explicit computations of vma page count with explicit function call. Signed-off-by: Dmitry Kalinkin dmitry.kalin...@gmail.com Acked-by: Julia Lawall julia.law...@lip6.fr

Re: [Cocci] [PATCH v2 1/4] coccinelle: pm_runtime: Insert blank line

2015-05-20 Thread Michal Marek
Dne 10.5.2015 v 04:15 Julia Lawall napsal(a): On Sat, 9 May 2015, Fabio Estevam wrote: From: Fabio Estevam fabio.este...@freescale.com Insert a blank line in order to improve the readability of the generated patch and also make it consistent with the other .cocci files. Signed-off-by:

Re: [Cocci] [PATCH] irqf_oneshot.cocci: add check of devm_request_threaded_irq()

2015-03-25 Thread Michal Marek
On Sun, Mar 22, 2015 at 11:29:13AM +0100, Julia Lawall wrote: Acked-by: Julia Lawall julia.law...@lip6.fr Good fix, thanks! Applied to kbuild.git#misc. Michal ___ Cocci mailing list Cocci@systeme.lip6.fr

Re: [Cocci] bugon.cocci: fix Options at the macro

2014-11-24 Thread Michal Marek
Dne 21.11.2014 v 19:07 Wolfram Sang napsal(a): On Fri, Nov 07, 2014 at 06:51:05PM +0100, Wolfram Sang wrote: On Tue, Oct 28, 2014 at 03:18:24PM -0200, Mauro Carvalho Chehab wrote: The comma after --no-includes makes coccinelle to not run the script: /usr/bin/spatch -D report --very-quiet

Re: [Cocci] [PATCH v2] coccinelle: misc: semantic patch to delete overly complex return code processing

2014-09-26 Thread Michal Marek
On Sat, Aug 23, 2014 at 07:34:45AM +0200, Julia Lawall wrote: From: Julia Lawall julia.law...@lip6.fr This semantic patch simplifies cases where the effect of the processing of a function call's return code is just to return the result of the function directly. It may also delete a local

Re: [Cocci] [PATCH] Coccinelle: Script to replace if and BUG with BUG_ON

2014-08-06 Thread Michal Marek
On 2014-08-05 20:16, Julia Lawall wrote: On Tue, 5 Aug 2014, Michal Marek wrote: On 2014-07-20 23:36, Himangi Saraogi wrote: This script detects cases where BUG() follows an if condition on an expression and replaces the if condition and BUG() with a BUG_ON having the conditional

Re: [Cocci] [PATCH] Coccinelle: Script to replace if and BUG with BUG_ON

2014-08-05 Thread Michal Marek
On 2014-07-20 23:36, Himangi Saraogi wrote: This script detects cases where BUG() follows an if condition on an expression and replaces the if condition and BUG() with a BUG_ON having the conditional expression of the if statement as argument. Signed-off-by: Himangi Saraogi

Re: [Cocci] [PATCH V2] coccicheck: Add unneeded return variable test

2014-06-10 Thread Michal Marek
On 2014-06-01 20:12, Peter Senna Tschudin wrote: This semantic patch looks for variables that are initialized with a constant, are never updated, and are only used as parameter of return. Return the constant instead of using a variable. Signed-off-by: Peter Senna Tschudin

Re: [Cocci] [PATCH] coccinelle/null: solve parse error

2014-06-09 Thread Michal Marek
(added the rest of the coccinelle gang to cc) Dne 28.5.2014 16:10, Himangi Saraogi napsal(a): This patch solves the parse-error by adding @@ . This is necessary since Coccinelle version 1.0.0-rc20. Also, the comment is added to use a recent version of Coccinelle. Signed-off-by: Himangi

Re: [Cocci] [PATCH resend] scripts: Coccinelle script for pm_runtime_* return checks with IS_ERR_VALUE

2014-01-03 Thread Michal Marek
On Fri, Jan 03, 2014 at 02:29:35PM +0100, Julia Lawall wrote: On Fri, 3 Jan 2014, Michal Marek wrote: On 2013-12-02 14:39, Nishanth Menon wrote: As indicated by Sekhar in [1], there seems to be a tendency to use IS_ERR_VALUE to check the error result for pm_runtime_* functions which

Re: [Cocci] [PATCHv2] coccinelle: Add a script to find unnecessary ifs with no body

2013-11-08 Thread Michal Marek
On 2.11.2013 17:49, Julia Lawall wrote: +@r depends on report || context@ +expression E; +position p; +@@ +if@p (E) {} There should be a * in front of the if, to support context mode. Josh, will you send a v3 with the above fix? Thanks, Michal

Re: [Cocci] [PATCH 1/4] Coccinelle: Restore coccicheck verbosity in ONLINE mode (C=1 or C=2)

2013-04-08 Thread Michal Marek
On 2.3.2013 22:36, Nicolas Palix wrote: A recent patch have introduce the VERBOSE variable and comments now depend on it. However, the message printed for each cocci file such not be printed when the ONLINE mode is active, whatever is the value of VERBOSE. Signed-off-by: Nicolas Palix

Re: [Cocci] [PATCH V2] scripts/coccinelle/misc/memcpy-assign.cocci: Replace memcpy with struct assignment

2013-02-22 Thread Michal Marek
On Wed, Jan 23, 2013 at 08:06:30PM -0200, Peter Senna Tschudin wrote: There are error-prone memcpy() that can be replaced by struct assignment that are type-safe and much easier to read. This semantic patch looks for memcpy() that can be replaced by struct assignment. Inspired by patches

Re: [Cocci] [PATCH] scripts/coccinelle/misc/warn.cocci: use WARN

2012-12-09 Thread Michal Marek
On Sat, Nov 03, 2012 at 09:02:09PM +0100, Julia Lawall wrote: From: Julia Lawall julia.law...@lip6.fr Use WARN(1,...) rather than printk followed by WARN(1). Signed-off-by: Julia Lawall julia.law...@lip6.fr --- scripts/coccinelle/misc/warn.cocci | 109

Re: [Cocci] [PATCH] Coccicheck: Improvement for online checking with 'make C=[12]'

2012-11-20 Thread Michal Marek
Hi Nicolas, sorry for the delay. On 12.10.2012 10:48, Nicolas Palix wrote: +# The ignore_unknown_options flag requires Coccinelle = 0.2.3 +FLAGS=-ignore_unknown_options -very_quiet +if [ $KBUILD_EXTMOD = ] ; then +OPTIONS=-dir $srctree $* Why is -Iinclude not needed in