summaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-05-27 04:42:37 +0000
committerDavid S. Miller <davem@davemloft.net>2009-05-27 15:47:06 -0700
commit1ce8e7b57b3a4527ef83da1c5c7bd8a6b9d87b56 (patch)
tree095536a47e40fdb621c1f959637fa63f57a4ccf2 /include/linux/netdevice.h
parent0bb32417ff0f6ac385e4eec3ef6641950bbb3694 (diff)
downloadtalos-obmc-linux-1ce8e7b57b3a4527ef83da1c5c7bd8a6b9d87b56.tar.gz
talos-obmc-linux-1ce8e7b57b3a4527ef83da1c5c7bd8a6b9d87b56.zip
net: ALIGN/PTR_ALIGN cleanup in alloc_netdev_mq()/netdev_priv()
Use ALIGN() and PTR_ALIGN() macros instead of handcoding them. Get rid of NETDEV_ALIGN_CONST ugly define Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 371ece521e58..14efce33c002 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -905,7 +905,6 @@ struct net_device
#define to_net_dev(d) container_of(d, struct net_device, dev)
#define NETDEV_ALIGN 32
-#define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1)
static inline
struct netdev_queue *netdev_get_tx_queue(const struct net_device *dev,
@@ -976,9 +975,7 @@ static inline bool netdev_uses_trailer_tags(struct net_device *dev)
*/
static inline void *netdev_priv(const struct net_device *dev)
{
- return (char *)dev + ((sizeof(struct net_device)
- + NETDEV_ALIGN_CONST)
- & ~NETDEV_ALIGN_CONST);
+ return (char *)dev + ALIGN(sizeof(struct net_device), NETDEV_ALIGN);
}
/* Set the sysfs physical device reference for the network logical device
OpenPOWER on IntegriCloud