diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2006-04-25 10:58:52 -0700 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-04-26 06:19:45 -0400 |
commit | 4a15d56f78936ec15a5d747546f25ace8fef9a03 (patch) | |
tree | 042e2b7315c1536f29927637efa9f1c6c9930a35 | |
parent | d27ed38765d6e01eaab443a7909f53a37f090e99 (diff) |
[PATCH] sky2: use ALIGN() macro
The ALIGN() macro in kernel.h does the same math that the
sky2 driver was using for padding.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r-- | drivers/net/sky2.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 6673ddf763a..393ee635b6c 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -925,8 +925,7 @@ static inline struct sk_buff *sky2_alloc_skb(unsigned int size, gfp_t gfp_mask) skb = alloc_skb(size + RX_SKB_ALIGN, gfp_mask); if (likely(skb)) { unsigned long p = (unsigned long) skb->data; - skb_reserve(skb, - ((p + RX_SKB_ALIGN - 1) & ~(RX_SKB_ALIGN - 1)) - p); + skb_reserve(skb, ALIGN(p, RX_SKB_ALIGN) - p); } return skb; @@ -1686,13 +1685,12 @@ static void sky2_tx_timeout(struct net_device *dev) } -#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* Want receive buffer size to be multiple of 64 bits * and incl room for vlan and truncation */ static inline unsigned sky2_buf_size(int mtu) { - return roundup(mtu + ETH_HLEN + VLAN_HLEN, 8) + 8; + return ALIGN(mtu + ETH_HLEN + VLAN_HLEN, 8) + 8; } static int sky2_change_mtu(struct net_device *dev, int new_mtu) |