x86/PCI: Convert release_resource to release_region/release_mem_region
authorJulia Lawall <julia@diku.dk>
Sun, 13 Feb 2011 12:12:11 +0000 (13:12 +0100)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Tue, 10 May 2011 22:43:30 +0000 (15:43 -0700)
commit0e8ede5351b53610363215f750e576ca1db1d0cd
tree632f1486569770166223247869bc821521cf8b80
parent83d74e036b94ffbf871667eede5ef02993709452
x86/PCI: Convert release_resource to release_region/release_mem_region

Request_region should be used with release_region, not release_resource.

The local variables region and region2 are dropped and the calls to
release_resource are replaced with calls to release_region, using the first
two arguments of the corresponding calls to request_region.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,E;
@@
(
*x = request_region(...)
|
*x = request_mem_region(...)
)
... when != release_region(x)
    when != x = E
* release_resource(x);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
arch/x86/pci/direct.c