linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yann Droneaud <ydroneaud@opteya.com>
To: Julia Lawall <Julia.Lawall@lip6.fr>,
	Gilles Muller <Gilles.Muller@lip6.fr>,
	Nicolas Palix <nicolas.palix@imag.fr>,
	Michal Marek <mmarek@suse.com>
Cc: Tejun Heo <tj@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org,
	Yann Droneaud <ydroneaud@opteya.com>,
	Joe Perches <joe@perches.com>,
	Manish Badarkhe <badarkhe.manish@gmail.com>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	Eli Billauer <eli.billauer@gmail.com>,
	Himangi Saraogi <himangi774@gmail.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Wolfram Sang <w.sang@pengutronix.de>,
	Daniel Thompson <daniel.thompson@linaro.org>
Subject: [PATCH v2 2/3] coccinelle: recognize more devm_* memory allocation functions
Date: Mon, 23 May 2016 17:07:20 +0200	[thread overview]
Message-ID: <ac950d1d8fca04ecc903f97083cb539ba538e7c2.1464013817.git.ydroneaud@opteya.com> (raw)
In-Reply-To: <cover.1464013817.git.ydroneaud@opteya.com>
In-Reply-To: <cover.1464013817.git.ydroneaud@opteya.com>

Updates free/devm_free.cocci to recognize functions added by:

- commit 64c862a839a8 ('devres: add kernel standard devm_k.alloc functions')
- commit e31108cad3de ('devres: introduce API "devm_kstrdup"')
- commit 3046365bb470 ('devres: introduce API "devm_kmemdup')
- commit 43339bed7010 ('devres: Add devm_get_free_pages API')
- commit 75f2a4ead5d5 ('devres: Add devm_kasprintf and devm_kvasprintf API')

See also Documentation/driver-model/devres.txt

Cc: Joe Perches <joe@perches.com>
Cc: Manish Badarkhe <badarkhe.manish@gmail.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Eli Billauer <eli.billauer@gmail.com>
Cc: Himangi Saraogi <himangi774@gmail.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Wolfram Sang <w.sang@pengutronix.de>
Cc: Daniel Thompson <daniel.thompson@linaro.org>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
---
 scripts/coccinelle/free/devm_free.cocci | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/scripts/coccinelle/free/devm_free.cocci b/scripts/coccinelle/free/devm_free.cocci
index 83c03adec1c5..3794cd97494b 100644
--- a/scripts/coccinelle/free/devm_free.cocci
+++ b/scripts/coccinelle/free/devm_free.cocci
@@ -29,8 +29,24 @@ expression x;
 @@
 
 (
+ x = devm_kmalloc(...)
+|
+ x = devm_kvasprintf(...)
+|
+ x = devm_kasprintf(...)
+|
  x = devm_kzalloc(...)
 |
+ x = devm_kmalloc_array(...)
+|
+ x = devm_kcalloc(...)
+|
+ x = devm_kstrdup(...)
+|
+ x = devm_kmemdup(...)
+|
+ x = devm_get_free_pages(...)
+|
  x = devm_request_irq(...)
 |
  x = devm_ioremap(...)
@@ -50,6 +66,10 @@ position p;
 |
 * kzfree@p(x)
 |
+* free_pages@p(x, ...)
+|
+* free_page@p(x)
+|
 * free_irq@p(x)
 |
 * iounmap@p(x)
-- 
2.7.4

  parent reply	other threads:[~2016-05-23 15:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-23 15:07 [PATCH v2 0/3] coccinelle: catchup on memory allocation functions Yann Droneaud
2016-05-23 15:07 ` [PATCH v2 1/3] coccinelle: also catch kzfree() issues Yann Droneaud
2016-05-23 15:18   ` Julia Lawall
2016-06-20 13:24     ` Michal Marek
2016-06-20 20:21       ` Julia Lawall
2016-06-21  9:43         ` Michal Marek
2016-06-21 11:14           ` Yann Droneaud
2016-06-21 11:17             ` Julia Lawall
2016-05-23 15:07 ` Yann Droneaud [this message]
2016-05-23 15:07 ` [PATCH v2 3/3] coccinelle: catch krealloc() on devm_*() allocated memory Yann Droneaud

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ac950d1d8fca04ecc903f97083cb539ba538e7c2.1464013817.git.ydroneaud@opteya.com \
    --to=ydroneaud@opteya.com \
    --cc=Gilles.Muller@lip6.fr \
    --cc=Julia.Lawall@lip6.fr \
    --cc=badarkhe.manish@gmail.com \
    --cc=cocci@systeme.lip6.fr \
    --cc=daniel.thompson@linaro.org \
    --cc=eli.billauer@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=himangi774@gmail.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.com \
    --cc=nicolas.palix@imag.fr \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=tj@kernel.org \
    --cc=w.sang@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).