aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
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 /include/linux/netdevice.h
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 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index a1c2c2204498..fdac1159253e 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -808,7 +808,9 @@ void dev_net_set(struct net_device *dev, struct net *net)
808 */ 808 */
809static inline void *netdev_priv(const struct net_device *dev) 809static inline void *netdev_priv(const struct net_device *dev)
810{ 810{
811 return dev->priv; 811 return (char *)dev + ((sizeof(struct net_device)
812 + NETDEV_ALIGN_CONST)
813 & ~NETDEV_ALIGN_CONST);
812} 814}
813 815
814/* Set the sysfs physical device reference for the network logical device 816/* Set the sysfs physical device reference for the network logical device