From f86225ee432e7d0ca8bd6cca78b0a48af7ef2d25 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Tue, 6 Apr 2004 00:28:52 -0400 Subject: [PATCH] remove magic '31' for netdev priv. alignment [resend/rediff] // linux-2.6.5 // remove magic number of '31' from net_device and private alignment; --- include/linux/netdevice.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include/linux') diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 378777e11e94..5c5a551fe630 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -484,9 +484,14 @@ struct net_device int padded; }; +#define NETDEV_ALIGN 32 +#define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1) + static inline void *netdev_priv(struct net_device *dev) { - return (char *)dev + ((sizeof(struct net_device) + 31) & ~31); + return (char *)dev + ((sizeof(struct net_device) + + NETDEV_ALIGN_CONST) + & ~NETDEV_ALIGN_CONST); } #define SET_MODULE_OWNER(dev) do { } while (0) -- cgit v1.2.3