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 <alexander.h.duyck@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Alexander Duyck 2014-12-03 08:17:52 -08:00 committed by David S. Miller
parent 74b6939de3
commit 28f7936cdf
1 changed files with 2 additions and 7 deletions

View File

@ -6651,13 +6651,8 @@ static netdev_tx_t niu_start_xmit(struct sk_buff *skb,
return NETDEV_TX_BUSY; return NETDEV_TX_BUSY;
} }
if (skb->len < ETH_ZLEN) { if (eth_skb_pad(skb))
unsigned int pad_bytes = ETH_ZLEN - skb->len; goto out;
if (skb_pad(skb, pad_bytes))
goto out;
skb_put(skb, pad_bytes);
}
len = sizeof(struct tx_pkt_hdr) + 15; len = sizeof(struct tx_pkt_hdr) + 15;
if (skb_headroom(skb) < len) { if (skb_headroom(skb) < len) {