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
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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 

Applied to kbuild.git#misc.

Thanks,
Michal
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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 matched somewhere.  Change the rules to propagate a
> position from the first rule to the others, to make sure that the sites
> reported on are the same as the sites that were identified as having the
> relevant functions.
> 
> Signed-off-by: Julia Lawall 

Applied to kbuild.git#misc.

Thanks,
Michal

___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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

___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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 
> 
>  1 file changed, 556 insertions(+)
>  create mode 100644 scripts/coccinelle/api/zalloc.cocci
> 
> diff --git a/scripts/coccinelle/api/zalloc.cocci 
> b/scripts/coccinelle/api/zalloc.cocci
> new file mode 100644
> index 000..4f94e43
> --- /dev/null
> +++ b/scripts/coccinelle/api/zalloc.cocci
> @@ -0,0 +1,556 @@
> +/// Prefer zalloc functions instead of using allocate and memcpy.

s/memcpy/memset/ ? The actual spatch names the correct function.

Michal
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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 privately over these changes and collected their Acks
>> privately to avoid unnecessary e-mail waste.
> 
> *Poke*

Applied to kbuild.git#misc.

Michal

___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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 3ef0e5ba4673 ('slab: introduce kzfree()'),
>>>> kfree() is no more the only function to be considered:
>>>> kzfree() should be recognized too.
>>>>
>>>> In particular, kzfree() must not be called on memory
>>>> allocated through devm_*() functions.
>>>>
>>>> Cc: Johannes Weiner <han...@cmpxchg.org>
>>>> Signed-off-by: Yann Droneaud <ydrone...@opteya.com>
>>>
>>> Acked-by: Julia Lawall <julia.law...@lip6.fr>
>>
>> Hi Julia,
>>
>> does your ACK apply to the other two patches as well?
> 
> Sorry, I seem to have missed the other two.  I have reviewed them now, and 
> the ack applies to all three.  Thanks for checking on it.

Np. Applied to kbuild.git#misc now.

Michal

___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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 as
>> second rule with arguments reversed. So, change that as well.
>>
>> Signed-off-by: Vaishali Thakkar 

Applied to kbuild.git#misc.

Michal

___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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) + \
>>> + (int(rel_specs['PATCHLEVEL']) << 16) + \
>>> + (sublevel<< 8 ) + \
>>> + (extra * 60) + (relmod * 2)
>>
>> This is going to silently break as soon as we have a version number with
>> e.g. a time stamp embedded. 
> 
> Well this is adhering to a linux_version_cmp type, surely we can adjust
> it with alternatives. It just happens that with the common stuff this
> suffices.
> 
> Do you have a specific string in mind I can use to test against?

You can have a look at the git history of scripts/ld-version.sh.


>> And there is actually no need to convert the
>> version string to an integer. You can convert them to arrays of
>> components and compare the components one by one.
> 
> You can, however weight is used to as a generic formula to determine
> in one shot if you have a release >= than what is required. Its inspired
> by how KERNEL_VERSION() is used:
> 
> #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

Yes, the kernel interface provides comparisons using the preprocessor
arithmetic, so it needs to convert the version strings to integers. But
you are providing methods to compare the versions and what happens in
these methods stays in these methods :).

Michal
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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
> +++ b/scripts/coccicheck
> @@ -12,6 +12,8 @@
>  
>  DIR=$(dirname $(readlink -f $0))
>  DIR="${DIR}/../"
> +export PYTHONPATH=${DIR}/scripts/

The first assignment to DIR already sets the desired path.

Michal
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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 to silently break as soon as we have a version number with
e.g. a time stamp embedded. And there is actually no need to convert the
version string to an integer. You can convert them to arrays of
components and compare the components one by one.

Michal
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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 rather see it removed.
> 
> An improvement is coming up, that should be more acceptable.  However, 
> it's being held up by the need for some bug fixes in Coccinelle.  A 
> release of Coccinelle is planned for the beginning of April.  Perhaps 
> it is just as well to just remove this version for now.
> 
> Acked-by: Julia Lawall 

Applied to kbuild.git#misc.

Michal
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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: Nishanth Menon 
>> Signed-off-by: Vaishali Thakkar 
> 
> Acked-by: Julia Lawall 

Applied to kbuild.git#misc.

Michal

___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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 1.0.4-00118-gc7cf750d1c44 compiled with OCaml
> version 4.01.0
> 
> 
> Tested-by: Nishanth Menon 

Applied to kbuild.git#misc with Cc: stable.

Michal
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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 

Applied to kbuild.git#misc, thanks.

Michal

___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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
https://systeme.lip6.fr/mailman/listinfo/cocci


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 nice :).


>> two -.
> 
> Acked-by: Julia Lawall 

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

___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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: i2c_device_id and platform_device_id.
>>
>> Signed-off-by: Daniel Granat 

Applied to kbuild.git#misc.

Michal

___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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: Adjust tests to compare against NULL
[PATCH 2/2] coccinelle: ifnullfree: handle various destroy functions

?

Michal
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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

___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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

___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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 not use assignment in if condition
 
 There is a gcc warning for this already.
 
 Michal
 
 
 ​My intention was not to create another way to uncover problems but
 rather to ​provide a tool for people to use to fix them. Let me know if
 I am misunderstanding the purpose of this subsystem.

OK, so this is fixing a style issue, and not cases of accidental
assignment instead of '==' (for which there is a gcc warning and we
hopefully do not have such errors in the kernel). While I'm probably
ignorant and no not see how one style is better than the other, I see
that some maintainers already applied your patches based on this check.
So I'll merge it once Julia acks it.

P.S.: Please switch of HTML email, otherwise vger.kernel.org won't
accept your messages.

Michal
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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
https://systeme.lip6.fr/mailman/listinfo/cocci


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 files.
 
 Acked-by: Julia Lawall julia.law...@lip6.fr

Applied to kbuild.git#misc.

Michal
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/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 generated patch by mentioning the commit
 log that makes threaded IRQs without a primary handler to be requested
 with the IRQF_ONESHOT flag.

 Signed-off-by: Fabio Estevam fabio.este...@freescale.com
 Acked- by: Valentin Rothberg valentinrothb...@gmail.com

Thanks, applied to kbuild.git#misc.

Michal
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Applied these two, thanks.

Michal

___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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

Thanks, applied to kbuild.git#misc.

Michal
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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: Fabio Estevam fabio.este...@freescale.com
 
 Acked-by: Julia Lawall julia.law...@lip6.fr

Applied all four to kbuild.git#misc.

Michal

___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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
https://systeme.lip6.fr/mailman/listinfo/cocci


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 --no-show-diff --cocci-file 
 ./scripts/coccinelle/misc/bugon.cocci --no-includes, --include-headers 
 --patch . --dir drivers/media/platform/coda/ -I ./arch/x86/include -I 
 arch/x86/include/generated -I include -I ./arch/x86/include/uapi -I 
 arch/x86/include/generated/uapi -I ./include/uapi -I include/generated/uapi 
 -I ./include/linux/kconfig.h
 Usage: spatch.opt --sp-file SP infile [-o outfile] [--iso-file iso] 
 [options]
 Options are:
   --sp-filefile the semantic patch file
   -o   file the output file
   --in-place   do the modification on the file directly
   --backup-suffix  suffix to use when making a backup for 
 inplace
 ...

 At least with Fedora 20 coccinelle package:
 coccinelle-1.0.0-0.rc20.1.fc21.x86_64

 Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com

 Yay, with this my patch handling scripts finally work again as they used
 to! Please let it go into 3.18.

 Tested-by: Wolfram Sang w...@the-dreams.de
 
 Ping.

Sorry for the delay. Applied now to kbuild.git#misc.

Michal

___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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 return flag variable, if this is no
 longer used.
 
 This was proposed by Uwe Kleine-König.
 
 Signed-off-by: Julia Lawall julia.law...@lip6.fr

Applied to kbuild.git#misc, thanks.

Michal
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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 expression of the if statement as argument.

 Signed-off-by: Himangi Saraogi himangi...@gmail.com
 Acked-by: Julia Lawall julia.law...@lip6.fr

 Is this a result of some internal review, or where does Julia's Acked-by
 come from? I'm just wondering, because I haven't seen any previous
 version of this patch.
 
 She sent it to me first.  It's OK with me.

OK, thanks for confirming. I'm going to merge this and the previous
patches by Himangi.

Michal
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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 himangi...@gmail.com
 Acked-by: Julia Lawall julia.law...@lip6.fr

Is this a result of some internal review, or where does Julia's Acked-by
come from? I'm just wondering, because I haven't seen any previous
version of this patch.

Thanks,
Michal
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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 peter.se...@gmail.com

Applied to kbuild.git#misc, thanks.

Michal

___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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 Saraogi himangi...@gmail.com
 Acked-by: Julia Lawall julia.law...@lip6.fr
 ---
  scripts/coccinelle/null/badzero.cocci | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/scripts/coccinelle/null/badzero.cocci 
 b/scripts/coccinelle/null/badzero.cocci
 index d79baf7..5551da2 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:
 +// Comments: Requires Coccinelle version 1.0.0-rc20 or later
  // Options:
  
  virtual patch
 @@ -19,6 +19,7 @@ virtual org
  virtual report
  
  @initialize:ocaml@
 +@@
  let negtable = Hashtbl.create 101
  
  @depends on patch@
 

___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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
   make no sense considering commit c48cd65 (ARM: OMAP: use consistent
   error checking) - the error values can either be  0 for error OR
   0, 1 in cases where we have success.
  
   So, setup a coccinelle script to help identify the same.
 
  Julia, Gilles, do you have any objections to this semantic patch?
 
 No objections.
 
 Acked-by: Julia Lawall julia.law...@lip6.fr

Thanks, applied to kbuild.git#misc.

Michal
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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

___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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 nicolas.pa...@imag.fr
 ---
  scripts/coccicheck |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

I applied these four to kbuild.git#misc.

Michal

___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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 sent by Ezequiel Garcia elezegar...@gmail.com
 
 Signed-off-by: Peter Senna Tschudin peter.se...@gmail.com
 ---
 Changes from V1:
  Updated commit message
  Changed Confidence comment to High on the semantic patch

Applied to kbuild.git#misc, thanks.

Michal
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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 
 +

Applied to kbuild.git#misc, thanks.

Michal
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


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 this case?


 +else
 +OPTIONS=-dir $KBUILD_EXTMOD -patch $srctree -I $srctree/include -I 
 $KBUILD_EXTMOD/include $*
 +fi

The main Makefile exports the $LINUXINCLUDE variable, which contains all
the needed -I options. It would be cleaner to use that instead.

Michal
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci