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  wrote:
>> Valentin?  (It's his semantic patch)
>>
>> julia
>>
>> On Sun, 24 May 2015, Fabio Estevam wrote:
>>
>>> From: Fabio Estevam 
>>>
>>> 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 
> Acked- by: Valentin Rothberg 

Thanks, 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 Valentin Rothberg
On Mon, May 25, 2015 at 8:21 AM, Julia Lawall  wrote:
> Valentin?  (It's his semantic patch)
>
> julia
>
> On Sun, 24 May 2015, Fabio Estevam wrote:
>
>> From: Fabio Estevam 
>>
>> 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 
>> ---
>>  scripts/coccinelle/misc/irqf_oneshot.cocci | 7 +--
>>  1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/scripts/coccinelle/misc/irqf_oneshot.cocci 
>> b/scripts/coccinelle/misc/irqf_oneshot.cocci
>> index b17ac8b..b421150 100644
>> --- a/scripts/coccinelle/misc/irqf_oneshot.cocci
>> +++ b/scripts/coccinelle/misc/irqf_oneshot.cocci
>> @@ -1,5 +1,8 @@
>> -/// Make sure threaded IRQs without a primary handler are always requested 
>> with
>> -/// IRQF_ONESHOT
>> +/// Since commit 1c6c69525b40 ("genirq: Reject bogus threaded irq requests")
>> +/// threaded IRQs without a primary handler need to be requested with
>> +/// IRQF_ONESHOT, otherwise the request will fail.
>> +///
>> +/// So pass the IRQF_ONESHOT flag in this case.
>>  ///
>>  //
>>  // Confidence: Good
>> --
>> 1.9.1
>>
>>

Acked- by: Valentin Rothberg 

Kind regards,
 Valentin
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


[Cocci] [PATCH 1/2] coccinelle: clk_put.cocci: Adjust commit log of generated patch

2015-05-25 Thread Fabio Estevam
The commit log should better describe the action that the patch will do.

In this case we are 'adding' the missing clk_put.

Signed-off-by: Fabio Estevam 
---
 scripts/coccinelle/free/clk_put.cocci | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/coccinelle/free/clk_put.cocci 
b/scripts/coccinelle/free/clk_put.cocci
index 46747ad..492b3b0 100644
--- a/scripts/coccinelle/free/clk_put.cocci
+++ b/scripts/coccinelle/free/clk_put.cocci
@@ -1,4 +1,4 @@
-/// Find missing clk_puts.
+/// Add missing clk_put.
 ///
 //# This only signals a missing clk_put when there is a clk_put later
 //# in the same function.
-- 
1.9.1

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


[Cocci] [PATCH 2/2] coccinelle: pci_free_consistent.cocci: Adjust commit log of generated patch

2015-05-25 Thread Fabio Estevam
The commit log should better describe the action that the patch will do.

In this case we are 'adding' the pci_free_consistent.

Signed-off-by: Fabio Estevam 
---
 scripts/coccinelle/free/pci_free_consistent.cocci | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/coccinelle/free/pci_free_consistent.cocci 
b/scripts/coccinelle/free/pci_free_consistent.cocci
index 43600cc..82b3e44 100644
--- a/scripts/coccinelle/free/pci_free_consistent.cocci
+++ b/scripts/coccinelle/free/pci_free_consistent.cocci
@@ -1,4 +1,4 @@
-/// Find missing pci_free_consistent for every pci_alloc_consistent.
+/// Add missing pci_free_consistent for every pci_alloc_consistent.
 ///
 // Confidence: Moderate
 // Copyright: (C) 2013 Petr Strnad.  GPLv2.
-- 
1.9.1

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


Re: [Cocci] [PATCH 2/2] coccinelle: pci_free_consistent.cocci: Adjust commit log of generated patch

2015-05-25 Thread Julia Lawall
On Mon, 25 May 2015, Fabio Estevam wrote:

> The commit log should better describe the action that the patch will do.
>
> In this case we are 'adding' the pci_free_consistent.

Not sure to follow the reasoning.  The semantic patch doesn't add
anything.

julia

>
> Signed-off-by: Fabio Estevam 
> ---
>  scripts/coccinelle/free/pci_free_consistent.cocci | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/coccinelle/free/pci_free_consistent.cocci 
> b/scripts/coccinelle/free/pci_free_consistent.cocci
> index 43600cc..82b3e44 100644
> --- a/scripts/coccinelle/free/pci_free_consistent.cocci
> +++ b/scripts/coccinelle/free/pci_free_consistent.cocci
> @@ -1,4 +1,4 @@
> -/// Find missing pci_free_consistent for every pci_alloc_consistent.
> +/// Add missing pci_free_consistent for every pci_alloc_consistent.
>  ///
>  // Confidence: Moderate
>  // Copyright: (C) 2013 Petr Strnad.  GPLv2.
> --
> 1.9.1
>
>
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


Re: [Cocci] [PATCH 1/2] coccinelle: clk_put.cocci: Adjust commit log of generated patch

2015-05-25 Thread Julia Lawall
On Mon, 25 May 2015, Fabio Estevam wrote:

> The commit log should better describe the action that the patch will do.
>
> In this case we are 'adding' the missing clk_put.

Here too, the semantic patch doesn't add anything.

julia

> Signed-off-by: Fabio Estevam 
> ---
>  scripts/coccinelle/free/clk_put.cocci | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/coccinelle/free/clk_put.cocci 
> b/scripts/coccinelle/free/clk_put.cocci
> index 46747ad..492b3b0 100644
> --- a/scripts/coccinelle/free/clk_put.cocci
> +++ b/scripts/coccinelle/free/clk_put.cocci
> @@ -1,4 +1,4 @@
> -/// Find missing clk_puts.
> +/// Add missing clk_put.
>  ///
>  //# This only signals a missing clk_put when there is a clk_put later
>  //# in the same function.
> --
> 1.9.1
>
>
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


Re: [Cocci] [PATCH 2/2] coccinelle: pci_free_consistent.cocci: Adjust commit log of generated patch

2015-05-25 Thread Fabio Estevam
On Mon, May 25, 2015 at 9:17 AM, Julia Lawall  wrote:
> On Mon, 25 May 2015, Fabio Estevam wrote:
>
>> The commit log should better describe the action that the patch will do.
>>
>> In this case we are 'adding' the pci_free_consistent.
>
> Not sure to follow the reasoning.  The semantic patch doesn't add
> anything.

Right, the semantich patch finds the missing pci_free_consistent, but
the generated patch is not finding pci_free_consistent. It is actually
adding the missing pci_free_consistent instead.

So in the commit log of the generated patch, we should better use
'add' instead of 'find'.

Regards,

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


Re: [Cocci] [PATCH 2/2] coccinelle: pci_free_consistent.cocci: Adjust commit log of generated patch

2015-05-25 Thread Fabio Estevam
On Mon, May 25, 2015 at 9:21 AM, Fabio Estevam  wrote:
> On Mon, May 25, 2015 at 9:17 AM, Julia Lawall  wrote:
>> On Mon, 25 May 2015, Fabio Estevam wrote:
>>
>>> The commit log should better describe the action that the patch will do.
>>>
>>> In this case we are 'adding' the pci_free_consistent.
>>
>> Not sure to follow the reasoning.  The semantic patch doesn't add
>> anything.
>
> Right, the semantich patch finds the missing pci_free_consistent, but
> the generated patch is not finding pci_free_consistent. It is actually
> adding the missing pci_free_consistent instead.
>
> So in the commit log of the generated patch, we should better use
> 'add' instead of 'find'.

Ok, I understood it new. It is really just detecting the missing free calls.

Please discard these two patches.
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


Re: [Cocci] [PATCH v3] Added tables i2c_device_id and platform_device_id for checking. Extend checking on tables containing structures which are initialized without specifying member name.

2015-05-25 Thread Julia Lawall


On Tue, 19 May 2015, Daniel Granat wrote:

> Signed-off-by: Daniel Granat 
> ---
>  scripts/coccinelle/misc/of_table.cocci | 26 +-
>  1 file changed, 21 insertions(+), 5 deletions(-)
> 
> diff --git a/scripts/coccinelle/misc/of_table.cocci 
> b/scripts/coccinelle/misc/of_table.cocci
> index 3c93404..74f7dbb 100644
> --- a/scripts/coccinelle/misc/of_table.cocci
> +++ b/scripts/coccinelle/misc/of_table.cocci
> @@ -1,6 +1,6 @@
> -/// Make sure of_device_id tables are NULL terminated
> +/// Make sure (of_device_id | i2c_device_id | platform_device_id) tables are 
> NULL terminated
>  //
> -// Keywords: of_table
> +// Keywords: of_table i2c_table platform_table
>  // Confidence: Medium
>  // Options: --include-headers
>  
> @@ -13,7 +13,7 @@ virtual report
>  identifier var, arr;
>  expression E;
>  @@
> -struct of_device_id arr[] = {
> +struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = {
>   ...,
>   {
>   .var = E,

This case (the context case) needs a ..., E, ... case like the patch rule 
has.


> @@ -24,7 +24,8 @@ struct of_device_id arr[] = {
>  identifier var, arr;
>  expression E;
>  @@
> -struct of_device_id arr[] = {
> +(
> +struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = {
>   ...,
>   {
>   .var = E,
> @@ -32,19 +33,34 @@ struct of_device_id arr[] = {
>  +},
>  +{ }
>  };
> +|
> +struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = {
> + ...,
> + { ..., E, ... },
> ++{ },
> +};
> +)
>  
>  @r depends on org || report@
>  position p1;
>  identifier var, arr;
>  expression E;
>  @@
> -struct of_device_id arr[] = {
> +(
> +struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = {
>   ...,
>   {
>   .var = E,
>   }
>   @p1
>  };
> +|
> +struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = {
> + ...,
> + { ..., E, ... },
> + @p1

It is not a good idea to put the @p1 on the comma.  The comma might not be 
there, and if it is not there Coccinelle seems to crash.  A more graceful 
behavior would be for the rule simply not to match, since a comma that 
isn't there doesn't have a position.  In any case, if you put the @p1 on 
the }, things are better.

I made the following test case, if you want to make a quick check of the 
rule.  All four options should give four results.

 static const struct platform_device_id ab85xx_rtc_ids[] = {
{ "ab8500-rtc", (kernel_ulong_t)&ab8500_rtc_ops, },
{ "ab8540-rtc", (kernel_ulong_t)&ab8540_rtc_ops, },
 };
 static const struct platform_device_id ab85xx_rtc_ids[] = {
{ "ab8500-rtc", (kernel_ulong_t)&ab8500_rtc_ops, },
{ "ab8540-rtc", (kernel_ulong_t)&ab8540_rtc_ops, }
 };
 static const struct platform_device_id ab85xx_rtc_ids[] = {
{ .a = "ab8500-rtc", .b = (kernel_ulong_t)&ab8500_rtc_ops, },
{ .a = "ab8540-rtc", .b = (kernel_ulong_t)&ab8540_rtc_ops, },
 };
 static const struct platform_device_id ab85xx_rtc_ids[] = {
{ .a = "ab8500-rtc", .b = (kernel_ulong_t)&ab8500_rtc_ops, },
{ .a = "ab8540-rtc", .b = (kernel_ulong_t)&ab8540_rtc_ops, }
 };

julia

> +};
> +)
>  
>  @script:python depends on org@
>  p1 << r.p1;
> -- 
> 1.9.1
> 
> 
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


Re: [Cocci] Packages for release 1.0.0

2015-05-25 Thread Eugeniy Meshcheryakov
Hello Julia,

29 квітня 2015 о 21:16 +0200 Julia Lawall написав(-ла):
> On Wed, 29 Apr 2015, Eliseo Martínez wrote:
> > I’ve seen release 1.0.0 has been published recently. Congrats!
> > Unfortunately, it seems distribution packages (at least those for Ubuntu) 
> > are still stuck on 1.0.0-rc23 (Oct 2014).
> > Are there plans to update these?
> 
> I could ping them, but I have already found a bug.  I'll see if I can fix 
> it by Monday.
I've packaged version 1.0.0-rc24 for Debian recently. Would packaging
1.0.0 be a regression compared to -rc24? Or should I go ahead and
package it?

Regards,
Eugeniy Meshcheryakov


signature.asc
Description: Digital signature
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


Re: [Cocci] Packages for release 1.0.0

2015-05-25 Thread Julia Lawall
On Tue, 26 May 2015, Eugeniy Meshcheryakov wrote:

> Hello Julia,
> 
> 29 квітня 2015 о 21:16 +0200 Julia Lawall написав(-ла):
> > On Wed, 29 Apr 2015, Eliseo Martínez wrote:
> > > I’ve seen release 1.0.0 has been published recently. Congrats!
> > > Unfortunately, it seems distribution packages (at least those for Ubuntu) 
> > > are still stuck on 1.0.0-rc23 (Oct 2014).
> > > Are there plans to update these?
> > 
> > I could ping them, but I have already found a bug.  I'll see if I can fix 
> > it by Monday.
> I've packaged version 1.0.0-rc24 for Debian recently. Would packaging
> 1.0.0 be a regression compared to -rc24? Or should I go ahead and
> package it?

1.0.0 would be an improvement.  I don't think that the problem was a 
regressin as compared to rc24.  Thanks.

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