From: Alexander Duyck Date: Wed, 3 Dec 2014 16:17:52 +0000 (-0800) Subject: niu: Use eth_skb_pad helper X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=28f7936cdf7d445570b214123f45866d3f6aa836;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git niu: Use eth_skb_pad helper Replace the standard layout for padding an ethernet frame with the eth_skb_pad call. Signed-off-by: Alexander Duyck Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c index 904fd1ab5f6e..4aaa3240453a 100644 --- a/drivers/net/ethernet/sun/niu.c +++ b/drivers/net/ethernet/sun/niu.c @@ -6651,13 +6651,8 @@ static netdev_tx_t niu_start_xmit(struct sk_buff *skb, return NETDEV_TX_BUSY; } - if (skb->len < ETH_ZLEN) { - unsigned int pad_bytes = ETH_ZLEN - skb->len; - - if (skb_pad(skb, pad_bytes)) - goto out; - skb_put(skb, pad_bytes); - } + if (eth_skb_pad(skb)) + goto out; len = sizeof(struct tx_pkt_hdr) + 15; if (skb_headroom(skb) < len) {