aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2017-01-03 19:34:48 -0500
committerDavid S. Miller <davem@davemloft.net>2017-01-04 13:33:28 -0500
commitbb7da333d0a9f3bddc08f84187b7579a3f68fd24 (patch)
treed6d420e50df49853a92e62ececb42e484e07ad8d
parentcd7aeb1f9706b665ad8659df8ff036e7bc0097f4 (diff)
net: systemport: Utilize skb_put_padto()
Since we need to pad our packets, utilize skb_put_padto() which increases skb->len by how much we need to pad, allowing us to eliminate the test on skb->len right below. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/broadcom/bcmsysport.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index 25d1eb4933d0..e67908b5edfe 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -1028,13 +1028,12 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb,
1028 * (including FCS and tag) because the length verification is done after 1028 * (including FCS and tag) because the length verification is done after
1029 * the Broadcom tag is stripped off the ingress packet. 1029 * the Broadcom tag is stripped off the ingress packet.
1030 */ 1030 */
1031 if (skb_padto(skb, ETH_ZLEN + ENET_BRCM_TAG_LEN)) { 1031 if (skb_put_padto(skb, ETH_ZLEN + ENET_BRCM_TAG_LEN)) {
1032 ret = NETDEV_TX_OK; 1032 ret = NETDEV_TX_OK;
1033 goto out; 1033 goto out;
1034 } 1034 }
1035 1035
1036 skb_len = skb->len < ETH_ZLEN + ENET_BRCM_TAG_LEN ? 1036 skb_len = skb->len;
1037 ETH_ZLEN + ENET_BRCM_TAG_LEN : skb->len;
1038 1037
1039 mapping = dma_map_single(kdev, skb->data, skb_len, DMA_TO_DEVICE); 1038 mapping = dma_map_single(kdev, skb->data, skb_len, DMA_TO_DEVICE);
1040 if (dma_mapping_error(kdev, mapping)) { 1039 if (dma_mapping_error(kdev, mapping)) {