* [PATCH 1/2] ATHEROS-ATL1E: Convert iounmap to pci_iounmap
@ 2014-03-18 16:11 Peter Senna Tschudin
2014-03-18 16:11 ` [PATCH 2/2] INTEL-IGB: " Peter Senna Tschudin
2014-03-18 20:13 ` [PATCH 1/2] ATHEROS-ATL1E: " David Miller
0 siblings, 2 replies; 4+ messages in thread
From: Peter Senna Tschudin @ 2014-03-18 16:11 UTC (permalink / raw)
To: jcliburn, chris.snook, davem, hannes, nhorman, kaber, sd,
PeterHuewe, andrea.merello, netdev, linux-kernel, kernel-janitors
Cc: Peter Senna Tschudin
Use pci_iounmap instead of iounmap when the virtual mapping was done
with pci_iomap. A simplified version of the semantic patch that finds this
issue is as follows: (http://coccinelle.lip6.fr/)
// <smpl>
@r@
expression addr;
@@
addr = pci_iomap(...)
@rr@
expression r.addr;
@@
* iounmap(addr)
// </smpl>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
---
Tested by compilation only.
drivers/net/ethernet/atheros/atl1e/atl1e_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
index d5c2d3e..422aab2 100644
--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
@@ -2436,7 +2436,7 @@ err_reset:
err_register:
err_sw_init:
err_eeprom:
- iounmap(adapter->hw.hw_addr);
+ pci_iounmap(pdev, adapter->hw.hw_addr);
err_init_netdev:
err_ioremap:
free_netdev(netdev);
@@ -2474,7 +2474,7 @@ static void atl1e_remove(struct pci_dev *pdev)
unregister_netdev(netdev);
atl1e_free_ring_resources(adapter);
atl1e_force_ps(&adapter->hw);
- iounmap(adapter->hw.hw_addr);
+ pci_iounmap(pdev, adapter->hw.hw_addr);
pci_release_regions(pdev);
free_netdev(netdev);
pci_disable_device(pdev);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] INTEL-IGB: Convert iounmap to pci_iounmap
2014-03-18 16:11 [PATCH 1/2] ATHEROS-ATL1E: Convert iounmap to pci_iounmap Peter Senna Tschudin
@ 2014-03-18 16:11 ` Peter Senna Tschudin
2014-03-19 4:33 ` Jeff Kirsher
2014-03-18 20:13 ` [PATCH 1/2] ATHEROS-ATL1E: " David Miller
1 sibling, 1 reply; 4+ messages in thread
From: Peter Senna Tschudin @ 2014-03-18 16:11 UTC (permalink / raw)
To: jeffrey.t.kirsher, jesse.brandeburg, bruce.w.allan,
carolyn.wyborny, donald.c.skidmore, gregory.v.rose,
alexander.h.duyck, john.ronciak, mitch.a.williams, linux.nics,
e1000-devel, netdev, linux-kernel, kernel-janitors
Cc: Peter Senna Tschudin
Use pci_iounmap instead of iounmap when the virtual mapping was done
with pci_iomap. A simplified version of the semantic patch that finds this
issue is as follows: (http://coccinelle.lip6.fr/)
// <smpl>
@r@
expression addr;
@@
addr = pci_iomap(...)
@rr@
expression r.addr;
@@
* iounmap(addr)
// </smpl>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
---
Tested by compilation only.
drivers/net/ethernet/intel/igb/igb_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 340a344..fc49177 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -2623,7 +2623,7 @@ err_eeprom:
iounmap(hw->flash_address);
err_sw_init:
igb_clear_interrupt_scheme(adapter);
- iounmap(hw->hw_addr);
+ pci_iounmap(pdev, hw->hw_addr);
err_ioremap:
free_netdev(netdev);
err_alloc_etherdev:
@@ -2790,7 +2790,7 @@ static void igb_remove(struct pci_dev *pdev)
igb_disable_sriov(pdev);
#endif
- iounmap(hw->hw_addr);
+ pci_iounmap(pdev, hw->hw_addr);
if (hw->flash_address)
iounmap(hw->flash_address);
pci_release_selected_regions(pdev,
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] ATHEROS-ATL1E: Convert iounmap to pci_iounmap
2014-03-18 16:11 [PATCH 1/2] ATHEROS-ATL1E: Convert iounmap to pci_iounmap Peter Senna Tschudin
2014-03-18 16:11 ` [PATCH 2/2] INTEL-IGB: " Peter Senna Tschudin
@ 2014-03-18 20:13 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2014-03-18 20:13 UTC (permalink / raw)
To: peter.senna
Cc: jcliburn, chris.snook, hannes, nhorman, kaber, sd, PeterHuewe,
andrea.merello, netdev, linux-kernel, kernel-janitors
From: Peter Senna Tschudin <peter.senna@gmail.com>
Date: Tue, 18 Mar 2014 17:11:24 +0100
> Use pci_iounmap instead of iounmap when the virtual mapping was done
> with pci_iomap. A simplified version of the semantic patch that finds this
> issue is as follows: (http://coccinelle.lip6.fr/)
...
> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] INTEL-IGB: Convert iounmap to pci_iounmap
2014-03-18 16:11 ` [PATCH 2/2] INTEL-IGB: " Peter Senna Tschudin
@ 2014-03-19 4:33 ` Jeff Kirsher
0 siblings, 0 replies; 4+ messages in thread
From: Jeff Kirsher @ 2014-03-19 4:33 UTC (permalink / raw)
To: Peter Senna Tschudin
Cc: jesse.brandeburg, bruce.w.allan, carolyn.wyborny,
donald.c.skidmore, gregory.v.rose, alexander.h.duyck,
john.ronciak, mitch.a.williams, linux.nics, e1000-devel, netdev,
linux-kernel, kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 692 bytes --]
On Tue, 2014-03-18 at 17:11 +0100, Peter Senna Tschudin wrote:
> Use pci_iounmap instead of iounmap when the virtual mapping was done
> with pci_iomap. A simplified version of the semantic patch that finds
> this
> issue is as follows: (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @r@
> expression addr;
> @@
> addr = pci_iomap(...)
>
> @rr@
> expression r.addr;
> @@
> * iounmap(addr)
> // </smpl>
>
> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
> ---
> Tested by compilation only.
>
> drivers/net/ethernet/intel/igb/igb_main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Thanks Peter, I have added you patch to my queue.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-03-19 4:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-18 16:11 [PATCH 1/2] ATHEROS-ATL1E: Convert iounmap to pci_iounmap Peter Senna Tschudin
2014-03-18 16:11 ` [PATCH 2/2] INTEL-IGB: " Peter Senna Tschudin
2014-03-19 4:33 ` Jeff Kirsher
2014-03-18 20:13 ` [PATCH 1/2] ATHEROS-ATL1E: " David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox