diff options
author | Wang Chen <wangchen@cn.fujitsu.com> | 2008-11-13 02:38:14 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-13 02:38:14 -0500 |
commit | 4cf1653aa90c6320dc8032443b5e322820aa28b1 (patch) | |
tree | 7920008d3f953defdcda8c81d39da963290d93ad /drivers/net/netxen | |
parent | 454d7c9b14e20fd1949e2686e9de4a2926e01476 (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/netxen')
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.c | 2 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index 84978f80f396..86379fdd8b0e 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -537,7 +537,7 @@ netxen_send_cmd_descs(struct netxen_adapter *adapter, | |||
537 | static int nx_p3_sre_macaddr_change(struct net_device *dev, | 537 | static int nx_p3_sre_macaddr_change(struct net_device *dev, |
538 | u8 *addr, unsigned op) | 538 | u8 *addr, unsigned op) |
539 | { | 539 | { |
540 | struct netxen_adapter *adapter = (struct netxen_adapter *)dev->priv; | 540 | struct netxen_adapter *adapter = netdev_priv(dev); |
541 | nx_nic_req_t req; | 541 | nx_nic_req_t req; |
542 | nx_mac_req_t mac_req; | 542 | nx_mac_req_t mac_req; |
543 | int rv; | 543 | int rv; |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 33caca90e80c..25bfb3acf5e4 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -541,7 +541,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
541 | 541 | ||
542 | SET_NETDEV_DEV(netdev, &pdev->dev); | 542 | SET_NETDEV_DEV(netdev, &pdev->dev); |
543 | 543 | ||
544 | adapter = netdev->priv; | 544 | adapter = netdev_priv(netdev); |
545 | adapter->netdev = netdev; | 545 | adapter->netdev = netdev; |
546 | adapter->pdev = pdev; | 546 | adapter->pdev = pdev; |
547 | adapter->ahw.pci_func = pci_func_id; | 547 | adapter->ahw.pci_func = pci_func_id; |
@@ -986,7 +986,7 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev) | |||
986 | */ | 986 | */ |
987 | static int netxen_nic_open(struct net_device *netdev) | 987 | static int netxen_nic_open(struct net_device *netdev) |
988 | { | 988 | { |
989 | struct netxen_adapter *adapter = (struct netxen_adapter *)netdev->priv; | 989 | struct netxen_adapter *adapter = netdev_priv(netdev); |
990 | int err = 0; | 990 | int err = 0; |
991 | int ctx, ring; | 991 | int ctx, ring; |
992 | irq_handler_t handler; | 992 | irq_handler_t handler; |