aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfram Sang <wsa@the-dreams.de>2013-08-15 06:30:25 -0400
committerMichal Marek <mmarek@suse.cz>2013-10-23 10:55:15 -0400
commita690876385f29c740798cb99aa2511217ecd9954 (patch)
treee0d82cda99c5dfbe3eecc645025e43f07dcc3131
parentf5a82137a53f4dbb61a1739c750c7cc22a4983e9 (diff)
scripts/coccinelle/api: remove devm_request_and_ioremap.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> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Michal Marek <mmarek@suse.cz>
-rw-r--r--scripts/coccinelle/api/devm_request_and_ioremap.cocci105
1 files changed, 0 insertions, 105 deletions
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 562ec88b6352..000000000000
--- a/scripts/coccinelle/api/devm_request_and_ioremap.cocci
+++ /dev/null
@@ -1,105 +0,0 @@
1/// Reimplement a call to devm_request_mem_region followed by a call to ioremap
2/// or ioremap_nocache by a call to devm_request_and_ioremap.
3/// Devm_request_and_ioremap was introduced in
4/// 72f8c0bfa0de64c68ee59f40eb9b2683bffffbb0. It makes the code much more
5/// concise.
6///
7///
8// Confidence: High
9// Copyright: (C) 2011 Julia Lawall, INRIA/LIP6. GPLv2.
10// Copyright: (C) 2011 Gilles Muller, INRIA/LiP6. GPLv2.
11// URL: http://coccinelle.lip6.fr/
12// Comments:
13// Options: --no-includes --include-headers
14
15virtual patch
16virtual org
17virtual report
18virtual context
19
20@nm@
21expression myname;
22identifier i;
23@@
24
25struct platform_driver i = { .driver = { .name = myname } };
26
27@depends on patch@
28expression dev,res,size;
29@@
30
31-if (!devm_request_mem_region(dev, res->start, size,
32- \(res->name\|dev_name(dev)\))) {
33- ...
34- return ...;
35-}
36... when != res->start
37(
38-devm_ioremap(dev,res->start,size)
39+devm_request_and_ioremap(dev,res)
40|
41-devm_ioremap_nocache(dev,res->start,size)
42+devm_request_and_ioremap(dev,res)
43)
44... when any
45 when != res->start
46
47// this rule is separate from the previous one, because a single file can
48// have multiple values of myname
49@depends on patch@
50expression dev,res,size;
51expression nm.myname;
52@@
53
54-if (!devm_request_mem_region(dev, res->start, size,myname)) {
55- ...
56- return ...;
57-}
58... when != res->start
59(
60-devm_ioremap(dev,res->start,size)
61+devm_request_and_ioremap(dev,res)
62|
63-devm_ioremap_nocache(dev,res->start,size)
64+devm_request_and_ioremap(dev,res)
65)
66... when any
67 when != res->start
68
69
70@pb depends on org || report || context@
71expression dev,res,size;
72expression nm.myname;
73position p1,p2;
74@@
75
76*if
77 (!devm_request_mem_region@p1(dev, res->start, size,
78 \(res->name\|dev_name(dev)\|myname\))) {
79 ...
80 return ...;
81}
82... when != res->start
83(
84*devm_ioremap@p2(dev,res->start,size)
85|
86*devm_ioremap_nocache@p2(dev,res->start,size)
87)
88... when any
89 when != res->start
90
91@script:python depends on org@
92p1 << pb.p1;
93p2 << pb.p2;
94@@
95
96cocci.print_main("INFO: replace by devm_request_and_ioremap",p1)
97cocci.print_secs("",p2)
98
99@script:python depends on report@
100p1 << pb.p1;
101p2 << pb.p2;
102@@
103
104msg = "INFO: devm_request_mem_region followed by ioremap on line %s can be replaced by devm_request_and_ioremap" % (p2[0].line)
105coccilib.report.print_report(p1[0],msg)