All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cocci] [PATCH] scripts/coccinelle/free/ifnullfree.cocci: simplify and extend to of_node_put
@ 2014-08-11 10:24 ` Julia Lawall
  0 siblings, 0 replies; 9+ messages in thread
From: Julia Lawall @ 2014-08-11 10:24 UTC (permalink / raw)
  To: cocci

From: Julia Lawall <Julia.Lawall@lip6.fr>

Three changes:

* Don't remove and add function calls in the patch case
* Add of_node_put as a considered function
* Add a missing position variable on usb_free_urb

The need for the last change was spotted by SF Markus Elfring.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 scripts/coccinelle/free/ifnullfree.cocci |   17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/scripts/coccinelle/free/ifnullfree.cocci b/scripts/coccinelle/free/ifnullfree.cocci
index a42d70b..31be901 100644
--- a/scripts/coccinelle/free/ifnullfree.cocci
+++ b/scripts/coccinelle/free/ifnullfree.cocci
@@ -18,17 +18,15 @@ expression E;
 @@
 - if (E)
 (
--	kfree(E);
-+ kfree(E);
+	kfree(E);
 |
--	debugfs_remove(E);
-+ debugfs_remove(E);
+	debugfs_remove(E);
 |
--	debugfs_remove_recursive(E);
-+ debugfs_remove_recursive(E);
+	debugfs_remove_recursive(E);
 |
--	usb_free_urb(E);
-+ usb_free_urb(E);
+	usb_free_urb(E);
+|
+	of_node_put(E);
 )
 
 @r depends on context || report || org @
@@ -37,7 +35,8 @@ position p;
 @@
 
 * if (E)
-*	\(kfree at p\|debugfs_remove at p\|debugfs_remove_recursive at p\|usb_free_urb\)(E);
+*  \(kfree at p\|debugfs_remove at p\|debugfs_remove_recursive at p\|usb_free_urb at p\|
+*    of_node_put at p\)(E);
 
 @script:python depends on org@
 p << r.p;

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

* [PATCH] scripts/coccinelle/free/ifnullfree.cocci: simplify and extend to of_node_put
@ 2014-08-11 10:24 ` Julia Lawall
  0 siblings, 0 replies; 9+ messages in thread
From: Julia Lawall @ 2014-08-11 10:24 UTC (permalink / raw)
  To: cocci

From: Julia Lawall <Julia.Lawall@lip6.fr>

Three changes:

* Don't remove and add function calls in the patch case
* Add of_node_put as a considered function
* Add a missing position variable on usb_free_urb

The need for the last change was spotted by SF Markus Elfring.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 scripts/coccinelle/free/ifnullfree.cocci |   17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/scripts/coccinelle/free/ifnullfree.cocci b/scripts/coccinelle/free/ifnullfree.cocci
index a42d70b..31be901 100644
--- a/scripts/coccinelle/free/ifnullfree.cocci
+++ b/scripts/coccinelle/free/ifnullfree.cocci
@@ -18,17 +18,15 @@ expression E;
 @@
 - if (E)
 (
--	kfree(E);
-+ kfree(E);
+	kfree(E);
 |
--	debugfs_remove(E);
-+ debugfs_remove(E);
+	debugfs_remove(E);
 |
--	debugfs_remove_recursive(E);
-+ debugfs_remove_recursive(E);
+	debugfs_remove_recursive(E);
 |
--	usb_free_urb(E);
-+ usb_free_urb(E);
+	usb_free_urb(E);
+|
+	of_node_put(E);
 )
 
 @r depends on context || report || org @
@@ -37,7 +35,8 @@ position p;
 @@
 
 * if (E)
-*	\(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb\)(E);
+*  \(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb@p\|
+*    of_node_put@p\)(E);
 
 @script:python depends on org@
 p << r.p;


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

* [PATCH] scripts/coccinelle/free/ifnullfree.cocci: simplify and extend to of_node_put
@ 2014-08-11 10:24 ` Julia Lawall
  0 siblings, 0 replies; 9+ messages in thread
From: Julia Lawall @ 2014-08-11 10:24 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kernel-janitors, Gilles Muller, Nicolas Palix, Michal Marek,
	cocci, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Three changes:

* Don't remove and add function calls in the patch case
* Add of_node_put as a considered function
* Add a missing position variable on usb_free_urb

The need for the last change was spotted by SF Markus Elfring.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 scripts/coccinelle/free/ifnullfree.cocci |   17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/scripts/coccinelle/free/ifnullfree.cocci b/scripts/coccinelle/free/ifnullfree.cocci
index a42d70b..31be901 100644
--- a/scripts/coccinelle/free/ifnullfree.cocci
+++ b/scripts/coccinelle/free/ifnullfree.cocci
@@ -18,17 +18,15 @@ expression E;
 @@
 - if (E)
 (
--	kfree(E);
-+ kfree(E);
+	kfree(E);
 |
--	debugfs_remove(E);
-+ debugfs_remove(E);
+	debugfs_remove(E);
 |
--	debugfs_remove_recursive(E);
-+ debugfs_remove_recursive(E);
+	debugfs_remove_recursive(E);
 |
--	usb_free_urb(E);
-+ usb_free_urb(E);
+	usb_free_urb(E);
+|
+	of_node_put(E);
 )
 
 @r depends on context || report || org @
@@ -37,7 +35,8 @@ position p;
 @@
 
 * if (E)
-*	\(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb\)(E);
+*  \(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb@p\|
+*    of_node_put@p\)(E);
 
 @script:python depends on org@
 p << r.p;


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

* [Cocci] [PATCH] scripts/coccinelle/free/ifnullfree.cocci: simplify and extend to of_node_put
  2014-08-11 10:24 ` Julia Lawall
  (?)
@ 2014-08-11 13:00   ` SF Markus Elfring
  -1 siblings, 0 replies; 9+ messages in thread
From: SF Markus Elfring @ 2014-08-11 13:00 UTC (permalink / raw)
  To: cocci

>  @r depends on context || report || org @
> @@ -37,7 +35,8 @@ position p;
>  @@
>  
>  * if (E)
> -*	\(kfree at p\|debugfs_remove at p\|debugfs_remove_recursive at p\|usb_free_urb\)(E);
> +*  \(kfree at p\|debugfs_remove at p\|debugfs_remove_recursive at p\|usb_free_urb at p\|
> +*    of_node_put at p\)(E);

Why do you want to limit this semantic patch pattern to such a small list of
function names?

Would you like to consider also the hundreds of other functions which perform
input parameter validation?
Are you interested to make the checked list more complete with further
(eventually automatic?) extensions?

Regards,
Markus

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

* Re: [PATCH] scripts/coccinelle/free/ifnullfree.cocci: simplify and extend to of_node_put
@ 2014-08-11 13:00   ` SF Markus Elfring
  0 siblings, 0 replies; 9+ messages in thread
From: SF Markus Elfring @ 2014-08-11 13:00 UTC (permalink / raw)
  To: cocci

>  @r depends on context || report || org @
> @@ -37,7 +35,8 @@ position p;
>  @@
>  
>  * if (E)
> -*	\(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb\)(E);
> +*  \(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb@p\|
> +*    of_node_put@p\)(E);

Why do you want to limit this semantic patch pattern to such a small list of
function names?

Would you like to consider also the hundreds of other functions which perform
input parameter validation?
Are you interested to make the checked list more complete with further
(eventually automatic?) extensions?

Regards,
Markus

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

* Re: [PATCH] scripts/coccinelle/free/ifnullfree.cocci: simplify and extend to of_node_put
@ 2014-08-11 13:00   ` SF Markus Elfring
  0 siblings, 0 replies; 9+ messages in thread
From: SF Markus Elfring @ 2014-08-11 13:00 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Coccinelle, kernel-janitors, Nicolas Palix, Michal Marek,
	linux-kernel

>  @r depends on context || report || org @
> @@ -37,7 +35,8 @@ position p;
>  @@
>  
>  * if (E)
> -*	\(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb\)(E);
> +*  \(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb@p\|
> +*    of_node_put@p\)(E);

Why do you want to limit this semantic patch pattern to such a small list of
function names?

Would you like to consider also the hundreds of other functions which perform
input parameter validation?
Are you interested to make the checked list more complete with further
(eventually automatic?) extensions?

Regards,
Markus

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

* [Cocci] [PATCH] scripts/coccinelle/free/ifnullfree.cocci: simplify and extend to of_node_put
  2014-08-11 13:00   ` SF Markus Elfring
  (?)
@ 2014-08-11 13:05     ` Julia Lawall
  -1 siblings, 0 replies; 9+ messages in thread
From: Julia Lawall @ 2014-08-11 13:05 UTC (permalink / raw)
  To: cocci



On Mon, 11 Aug 2014, SF Markus Elfring wrote:

> >  @r depends on context || report || org @
> > @@ -37,7 +35,8 @@ position p;
> >  @@
> >
> >  * if (E)
> > -*	\(kfree at p\|debugfs_remove at p\|debugfs_remove_recursive at p\|usb_free_urb\)(E);
> > +*  \(kfree at p\|debugfs_remove at p\|debugfs_remove_recursive at p\|usb_free_urb at p\|
> > +*    of_node_put at p\)(E);
>
> Why do you want to limit this semantic patch pattern to such a small list of
> function names?

Because these are the ones that kernel developers have cited as
interesting for this kind of transformation.

> Would you like to consider also the hundreds of other functions which perform
> input parameter validation?

Personally, no.  I think I have explained why several times already.

julia

> Are you interested to make the checked list more complete with further
> (eventually automatic?) extensions?
>
> Regards,
> Markus
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* Re: [PATCH] scripts/coccinelle/free/ifnullfree.cocci: simplify and extend to of_node_put
@ 2014-08-11 13:05     ` Julia Lawall
  0 siblings, 0 replies; 9+ messages in thread
From: Julia Lawall @ 2014-08-11 13:05 UTC (permalink / raw)
  To: cocci



On Mon, 11 Aug 2014, SF Markus Elfring wrote:

> >  @r depends on context || report || org @
> > @@ -37,7 +35,8 @@ position p;
> >  @@
> >
> >  * if (E)
> > -*	\(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb\)(E);
> > +*  \(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb@p\|
> > +*    of_node_put@p\)(E);
>
> Why do you want to limit this semantic patch pattern to such a small list of
> function names?

Because these are the ones that kernel developers have cited as
interesting for this kind of transformation.

> Would you like to consider also the hundreds of other functions which perform
> input parameter validation?

Personally, no.  I think I have explained why several times already.

julia

> Are you interested to make the checked list more complete with further
> (eventually automatic?) extensions?
>
> Regards,
> Markus
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* Re: [PATCH] scripts/coccinelle/free/ifnullfree.cocci: simplify and extend to of_node_put
@ 2014-08-11 13:05     ` Julia Lawall
  0 siblings, 0 replies; 9+ messages in thread
From: Julia Lawall @ 2014-08-11 13:05 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: Julia Lawall, Coccinelle, kernel-janitors, Nicolas Palix,
	Michal Marek, linux-kernel



On Mon, 11 Aug 2014, SF Markus Elfring wrote:

> >  @r depends on context || report || org @
> > @@ -37,7 +35,8 @@ position p;
> >  @@
> >
> >  * if (E)
> > -*	\(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb\)(E);
> > +*  \(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb@p\|
> > +*    of_node_put@p\)(E);
>
> Why do you want to limit this semantic patch pattern to such a small list of
> function names?

Because these are the ones that kernel developers have cited as
interesting for this kind of transformation.

> Would you like to consider also the hundreds of other functions which perform
> input parameter validation?

Personally, no.  I think I have explained why several times already.

julia

> Are you interested to make the checked list more complete with further
> (eventually automatic?) extensions?
>
> Regards,
> Markus
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

end of thread, other threads:[~2014-08-11 13:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-11 10:24 [Cocci] [PATCH] scripts/coccinelle/free/ifnullfree.cocci: simplify and extend to of_node_put Julia Lawall
2014-08-11 10:24 ` Julia Lawall
2014-08-11 10:24 ` Julia Lawall
2014-08-11 13:00 ` [Cocci] " SF Markus Elfring
2014-08-11 13:00   ` SF Markus Elfring
2014-08-11 13:00   ` SF Markus Elfring
2014-08-11 13:05   ` [Cocci] " Julia Lawall
2014-08-11 13:05     ` Julia Lawall
2014-08-11 13:05     ` Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.