aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000
diff options
context:
space:
mode:
authorWang Chen <wangchen@cn.fujitsu.com>2008-11-13 02:38:14 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-13 02:38:14 -0500
commit4cf1653aa90c6320dc8032443b5e322820aa28b1 (patch)
tree7920008d3f953defdcda8c81d39da963290d93ad /drivers/net/e1000
parent454d7c9b14e20fd1949e2686e9de4a2926e01476 (diff)
netdevice: safe convert to netdev_priv() #part-2
We have some reasons to kill netdev->priv: 1. netdev->priv is equal to netdev_priv(). 2. netdev_priv() wraps the calculation of netdev->priv's offset, obviously netdev_priv() is more flexible than netdev->priv. But we cann't kill netdev->priv, because so many drivers reference to it directly. This patch is a safe convert for netdev->priv to netdev_priv(netdev). Since all of the netdev->priv is only for read. But it is too big to be sent in one mail. I split it to 4 parts and make every part smaller than 100,000 bytes, which is max size allowed by vger. Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/e1000')
-rw-r--r--drivers/net/e1000/e1000_main.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 78a4250e004f..7dd4ded13d97 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3786,8 +3786,7 @@ static int e1000_clean(struct napi_struct *napi, int budget)
3786 struct net_device *poll_dev = adapter->netdev; 3786 struct net_device *poll_dev = adapter->netdev;
3787 int tx_cleaned = 0, work_done = 0; 3787 int tx_cleaned = 0, work_done = 0;
3788 3788
3789 /* Must NOT use netdev_priv macro here. */ 3789 adapter = netdev_priv(poll_dev);
3790 adapter = poll_dev->priv;
3791 3790
3792 /* e1000_clean is called per-cpu. This lock protects 3791 /* e1000_clean is called per-cpu. This lock protects
3793 * tx_ring[0] from being cleaned by multiple cpus 3792 * tx_ring[0] from being cleaned by multiple cpus
@@ -4782,7 +4781,7 @@ static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev,
4782 pci_channel_state_t state) 4781 pci_channel_state_t state)
4783{ 4782{
4784 struct net_device *netdev = pci_get_drvdata(pdev); 4783 struct net_device *netdev = pci_get_drvdata(pdev);
4785 struct e1000_adapter *adapter = netdev->priv; 4784 struct e1000_adapter *adapter = netdev_priv(netdev);
4786 4785
4787 netif_device_detach(netdev); 4786 netif_device_detach(netdev);
4788 4787
@@ -4804,7 +4803,7 @@ static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev,
4804static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev) 4803static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev)
4805{ 4804{
4806 struct net_device *netdev = pci_get_drvdata(pdev); 4805 struct net_device *netdev = pci_get_drvdata(pdev);
4807 struct e1000_adapter *adapter = netdev->priv; 4806 struct e1000_adapter *adapter = netdev_priv(netdev);
4808 struct e1000_hw *hw = &adapter->hw; 4807 struct e1000_hw *hw = &adapter->hw;
4809 int err; 4808 int err;
4810 4809
@@ -4838,7 +4837,7 @@ static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev)
4838static void e1000_io_resume(struct pci_dev *pdev) 4837static void e1000_io_resume(struct pci_dev *pdev)
4839{ 4838{
4840 struct net_device *netdev = pci_get_drvdata(pdev); 4839 struct net_device *netdev = pci_get_drvdata(pdev);
4841 struct e1000_adapter *adapter = netdev->priv; 4840 struct e1000_adapter *adapter = netdev_priv(netdev);
4842 struct e1000_hw *hw = &adapter->hw; 4841 struct e1000_hw *hw = &adapter->hw;
4843 4842
4844 e1000_init_manageability(adapter); 4843 e1000_init_manageability(adapter);