* [PATCH] scripts/coccinelle/api: remove devm_request_and_ioremap.cocci
@ 2013-08-15 10:30 Wolfram Sang
2013-08-15 10:45 ` Julia Lawall
2013-10-06 13:49 ` Wolfram Sang
0 siblings, 2 replies; 5+ messages in thread
From: Wolfram Sang @ 2013-08-15 10:30 UTC (permalink / raw)
To: linux-kernel
Cc: Wolfram Sang, Julia Lawall, Gilles Muller, Nicolas Palix,
Michal Marek, cocci
Use of this function is discouraged in favour of
devm_ioremap_resource(). Don't advertise it.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
.../coccinelle/api/devm_request_and_ioremap.cocci | 105 --------------------
1 file changed, 105 deletions(-)
delete mode 100644 scripts/coccinelle/api/devm_request_and_ioremap.cocci
diff --git a/scripts/coccinelle/api/devm_request_and_ioremap.cocci b/scripts/coccinelle/api/devm_request_and_ioremap.cocci
deleted file mode 100644
index 562ec88..0000000
--- a/scripts/coccinelle/api/devm_request_and_ioremap.cocci
+++ /dev/null
@@ -1,105 +0,0 @@
-/// Reimplement a call to devm_request_mem_region followed by a call to ioremap
-/// or ioremap_nocache by a call to devm_request_and_ioremap.
-/// Devm_request_and_ioremap was introduced in
-/// 72f8c0bfa0de64c68ee59f40eb9b2683bffffbb0. It makes the code much more
-/// concise.
-///
-///
-// Confidence: High
-// Copyright: (C) 2011 Julia Lawall, INRIA/LIP6. GPLv2.
-// Copyright: (C) 2011 Gilles Muller, INRIA/LiP6. GPLv2.
-// URL: http://coccinelle.lip6.fr/
-// Comments:
-// Options: --no-includes --include-headers
-
-virtual patch
-virtual org
-virtual report
-virtual context
-
-@nm@
-expression myname;
-identifier i;
-@@
-
-struct platform_driver i = { .driver = { .name = myname } };
-
-@depends on patch@
-expression dev,res,size;
-@@
-
--if (!devm_request_mem_region(dev, res->start, size,
-- \(res->name\|dev_name(dev)\))) {
-- ...
-- return ...;
--}
-... when != res->start
-(
--devm_ioremap(dev,res->start,size)
-+devm_request_and_ioremap(dev,res)
-|
--devm_ioremap_nocache(dev,res->start,size)
-+devm_request_and_ioremap(dev,res)
-)
-... when any
- when != res->start
-
-// this rule is separate from the previous one, because a single file can
-// have multiple values of myname
-@depends on patch@
-expression dev,res,size;
-expression nm.myname;
-@@
-
--if (!devm_request_mem_region(dev, res->start, size,myname)) {
-- ...
-- return ...;
--}
-... when != res->start
-(
--devm_ioremap(dev,res->start,size)
-+devm_request_and_ioremap(dev,res)
-|
--devm_ioremap_nocache(dev,res->start,size)
-+devm_request_and_ioremap(dev,res)
-)
-... when any
- when != res->start
-
-
-@pb depends on org || report || context@
-expression dev,res,size;
-expression nm.myname;
-position p1,p2;
-@@
-
-*if
- (!devm_request_mem_region@p1(dev, res->start, size,
- \(res->name\|dev_name(dev)\|myname\))) {
- ...
- return ...;
-}
-... when != res->start
-(
-*devm_ioremap@p2(dev,res->start,size)
-|
-*devm_ioremap_nocache@p2(dev,res->start,size)
-)
-... when any
- when != res->start
-
-@script:python depends on org@
-p1 << pb.p1;
-p2 << pb.p2;
-@@
-
-cocci.print_main("INFO: replace by devm_request_and_ioremap",p1)
-cocci.print_secs("",p2)
-
-@script:python depends on report@
-p1 << pb.p1;
-p2 << pb.p2;
-@@
-
-msg = "INFO: devm_request_mem_region followed by ioremap on line %s can be replaced by devm_request_and_ioremap" % (p2[0].line)
-coccilib.report.print_report(p1[0],msg)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] scripts/coccinelle/api: remove devm_request_and_ioremap.cocci
2013-08-15 10:30 [PATCH] scripts/coccinelle/api: remove devm_request_and_ioremap.cocci Wolfram Sang
@ 2013-08-15 10:45 ` Julia Lawall
2013-10-06 13:49 ` Wolfram Sang
1 sibling, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2013-08-15 10:45 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-kernel, Julia Lawall, Gilles Muller, Nicolas Palix,
Michal Marek, cocci
Acked-by: Julia Lawall <Julia.Lawall@lip6.fr>
On Thu, 15 Aug 2013, Wolfram Sang wrote:
> Use of this function is discouraged in favour of
> devm_ioremap_resource(). Don't advertise it.
>
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
> ---
> .../coccinelle/api/devm_request_and_ioremap.cocci | 105 --------------------
> 1 file changed, 105 deletions(-)
> delete mode 100644 scripts/coccinelle/api/devm_request_and_ioremap.cocci
>
> diff --git a/scripts/coccinelle/api/devm_request_and_ioremap.cocci b/scripts/coccinelle/api/devm_request_and_ioremap.cocci
> deleted file mode 100644
> index 562ec88..0000000
> --- a/scripts/coccinelle/api/devm_request_and_ioremap.cocci
> +++ /dev/null
> @@ -1,105 +0,0 @@
> -/// Reimplement a call to devm_request_mem_region followed by a call to ioremap
> -/// or ioremap_nocache by a call to devm_request_and_ioremap.
> -/// Devm_request_and_ioremap was introduced in
> -/// 72f8c0bfa0de64c68ee59f40eb9b2683bffffbb0. It makes the code much more
> -/// concise.
> -///
> -///
> -// Confidence: High
> -// Copyright: (C) 2011 Julia Lawall, INRIA/LIP6. GPLv2.
> -// Copyright: (C) 2011 Gilles Muller, INRIA/LiP6. GPLv2.
> -// URL: http://coccinelle.lip6.fr/
> -// Comments:
> -// Options: --no-includes --include-headers
> -
> -virtual patch
> -virtual org
> -virtual report
> -virtual context
> -
> -@nm@
> -expression myname;
> -identifier i;
> -@@
> -
> -struct platform_driver i = { .driver = { .name = myname } };
> -
> -@depends on patch@
> -expression dev,res,size;
> -@@
> -
> --if (!devm_request_mem_region(dev, res->start, size,
> -- \(res->name\|dev_name(dev)\))) {
> -- ...
> -- return ...;
> --}
> -... when != res->start
> -(
> --devm_ioremap(dev,res->start,size)
> -+devm_request_and_ioremap(dev,res)
> -|
> --devm_ioremap_nocache(dev,res->start,size)
> -+devm_request_and_ioremap(dev,res)
> -)
> -... when any
> - when != res->start
> -
> -// this rule is separate from the previous one, because a single file can
> -// have multiple values of myname
> -@depends on patch@
> -expression dev,res,size;
> -expression nm.myname;
> -@@
> -
> --if (!devm_request_mem_region(dev, res->start, size,myname)) {
> -- ...
> -- return ...;
> --}
> -... when != res->start
> -(
> --devm_ioremap(dev,res->start,size)
> -+devm_request_and_ioremap(dev,res)
> -|
> --devm_ioremap_nocache(dev,res->start,size)
> -+devm_request_and_ioremap(dev,res)
> -)
> -... when any
> - when != res->start
> -
> -
> -@pb depends on org || report || context@
> -expression dev,res,size;
> -expression nm.myname;
> -position p1,p2;
> -@@
> -
> -*if
> - (!devm_request_mem_region@p1(dev, res->start, size,
> - \(res->name\|dev_name(dev)\|myname\))) {
> - ...
> - return ...;
> -}
> -... when != res->start
> -(
> -*devm_ioremap@p2(dev,res->start,size)
> -|
> -*devm_ioremap_nocache@p2(dev,res->start,size)
> -)
> -... when any
> - when != res->start
> -
> -@script:python depends on org@
> -p1 << pb.p1;
> -p2 << pb.p2;
> -@@
> -
> -cocci.print_main("INFO: replace by devm_request_and_ioremap",p1)
> -cocci.print_secs("",p2)
> -
> -@script:python depends on report@
> -p1 << pb.p1;
> -p2 << pb.p2;
> -@@
> -
> -msg = "INFO: devm_request_mem_region followed by ioremap on line %s can be replaced by devm_request_and_ioremap" % (p2[0].line)
> -coccilib.report.print_report(p1[0],msg)
> --
> 1.7.10.4
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scripts/coccinelle/api: remove devm_request_and_ioremap.cocci
2013-08-15 10:30 [PATCH] scripts/coccinelle/api: remove devm_request_and_ioremap.cocci Wolfram Sang
2013-08-15 10:45 ` Julia Lawall
@ 2013-10-06 13:49 ` Wolfram Sang
2013-10-06 13:53 ` Julia Lawall
1 sibling, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2013-10-06 13:49 UTC (permalink / raw)
To: linux-kernel
Cc: Julia Lawall, Gilles Muller, Nicolas Palix, Michal Marek, cocci
[-- Attachment #1: Type: text/plain, Size: 229 bytes --]
On Thu, Aug 15, 2013 at 12:30:25PM +0200, Wolfram Sang wrote:
> Use of this function is discouraged in favour of
> devm_ioremap_resource(). Don't advertise it.
>
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Ping.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scripts/coccinelle/api: remove devm_request_and_ioremap.cocci
2013-10-06 13:49 ` Wolfram Sang
@ 2013-10-06 13:53 ` Julia Lawall
2013-10-23 14:56 ` Michal Marek
0 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2013-10-06 13:53 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-kernel, Julia Lawall, Gilles Muller, Nicolas Palix,
Michal Marek, cocci
On Sun, 6 Oct 2013, Wolfram Sang wrote:
> On Thu, Aug 15, 2013 at 12:30:25PM +0200, Wolfram Sang wrote:
> > Use of this function is discouraged in favour of
> > devm_ioremap_resource(). Don't advertise it.
> >
> > Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
>
> Ping.
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scripts/coccinelle/api: remove devm_request_and_ioremap.cocci
2013-10-06 13:53 ` Julia Lawall
@ 2013-10-23 14:56 ` Michal Marek
0 siblings, 0 replies; 5+ messages in thread
From: Michal Marek @ 2013-10-23 14:56 UTC (permalink / raw)
To: Julia Lawall, Wolfram Sang
Cc: linux-kernel, Gilles Muller, Nicolas Palix, cocci
On 6.10.2013 15:53, Julia Lawall wrote:
> On Sun, 6 Oct 2013, Wolfram Sang wrote:
>
>> On Thu, Aug 15, 2013 at 12:30:25PM +0200, Wolfram Sang wrote:
>>> Use of this function is discouraged in favour of
>>> devm_ioremap_resource(). Don't advertise it.
>>>
>>> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
>
> Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Applied to kbuild.git#misc now. For some reason, I overlooked the patch
before.
Michal
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-10-23 14:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-15 10:30 [PATCH] scripts/coccinelle/api: remove devm_request_and_ioremap.cocci Wolfram Sang
2013-08-15 10:45 ` Julia Lawall
2013-10-06 13:49 ` Wolfram Sang
2013-10-06 13:53 ` Julia Lawall
2013-10-23 14:56 ` Michal Marek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox