aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/loopback.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-07-15 05:58:39 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-17 22:21:09 -0400
commite3c50d5d25ac09efd9acbe2b2a3e365466de84ed (patch)
treedc5bc3322f9e4829c2143fc4fc60532fd84ab9a1 /drivers/net/loopback.c
parent6b0fb1261a4655613bed5dac0e935e733969e999 (diff)
netdev: netdev_priv() can now be sane again.
The private area of a netdev is now at a fixed offset once more. Unfortunately, some assumptions that netdev_priv() == netdev->priv crept back into the tree. In particular this happened in the loopback driver. Make it use netdev->ml_priv. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/loopback.c')
-rw-r--r--drivers/net/loopback.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index 41b774baac4d..49f6bc036a92 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -153,7 +153,7 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev)
153 dev->last_rx = jiffies; 153 dev->last_rx = jiffies;
154 154
155 /* it's OK to use per_cpu_ptr() because BHs are off */ 155 /* it's OK to use per_cpu_ptr() because BHs are off */
156 pcpu_lstats = netdev_priv(dev); 156 pcpu_lstats = dev->ml_priv;
157 lb_stats = per_cpu_ptr(pcpu_lstats, smp_processor_id()); 157 lb_stats = per_cpu_ptr(pcpu_lstats, smp_processor_id());
158 lb_stats->bytes += skb->len; 158 lb_stats->bytes += skb->len;
159 lb_stats->packets++; 159 lb_stats->packets++;
@@ -171,7 +171,7 @@ static struct net_device_stats *get_stats(struct net_device *dev)
171 unsigned long packets = 0; 171 unsigned long packets = 0;
172 int i; 172 int i;
173 173
174 pcpu_lstats = netdev_priv(dev); 174 pcpu_lstats = dev->ml_priv;
175 for_each_possible_cpu(i) { 175 for_each_possible_cpu(i) {
176 const struct pcpu_lstats *lb_stats; 176 const struct pcpu_lstats *lb_stats;
177 177
@@ -207,13 +207,13 @@ static int loopback_dev_init(struct net_device *dev)
207 if (!lstats) 207 if (!lstats)
208 return -ENOMEM; 208 return -ENOMEM;
209 209
210 dev->priv = lstats; 210 dev->ml_priv = lstats;
211 return 0; 211 return 0;
212} 212}
213 213
214static void loopback_dev_free(struct net_device *dev) 214static void loopback_dev_free(struct net_device *dev)
215{ 215{
216 struct pcpu_lstats *lstats = netdev_priv(dev); 216 struct pcpu_lstats *lstats = dev->ml_priv;
217 217
218 free_percpu(lstats); 218 free_percpu(lstats);
219 free_netdev(dev); 219 free_netdev(dev);