Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a15d56f authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Jeff Garzik
Browse files

[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: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent d27ed387
Loading
Loading
Loading
Loading
+2 −4
Original line number Original line Diff line number Diff line
@@ -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);
	skb = alloc_skb(size + RX_SKB_ALIGN, gfp_mask);
	if (likely(skb)) {
	if (likely(skb)) {
		unsigned long p	= (unsigned long) skb->data;
		unsigned long p	= (unsigned long) skb->data;
		skb_reserve(skb,
		skb_reserve(skb, ALIGN(p, RX_SKB_ALIGN) - p);
			((p + RX_SKB_ALIGN - 1) & ~(RX_SKB_ALIGN - 1)) - p);
	}
	}


	return skb;
	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
/* Want receive buffer size to be multiple of 64 bits
 * and incl room for vlan and truncation
 * and incl room for vlan and truncation
 */
 */
static inline unsigned sky2_buf_size(int mtu)
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)
static int sky2_change_mtu(struct net_device *dev, int new_mtu)