aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfrançois romieu <romieu@fr.zoreil.com>2014-03-29 07:26:26 -0400
committerDavid S. Miller <davem@davemloft.net>2014-03-29 17:49:47 -0400
commitba4e6d19202a6aaa7207fde08310961df5197981 (patch)
tree503cedcf9b169d14e05498cf16c99da2d24c7422
parentd8e4435e1644308b8f024630bdf5ecd111bafe20 (diff)
jme: remove open-coded skb_cow_head.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Guo-Fu Tseng <cooldavid@cooldavid.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/jme.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c
index 14ff8d64257d..b0c6050479eb 100644
--- a/drivers/net/ethernet/jme.c
+++ b/drivers/net/ethernet/jme.c
@@ -2054,19 +2054,6 @@ jme_map_tx_skb(struct jme_adapter *jme, struct sk_buff *skb, int idx)
2054} 2054}
2055 2055
2056static int 2056static int
2057jme_expand_header(struct jme_adapter *jme, struct sk_buff *skb)
2058{
2059 if (unlikely(skb_shinfo(skb)->gso_size &&
2060 skb_header_cloned(skb) &&
2061 pskb_expand_head(skb, 0, 0, GFP_ATOMIC))) {
2062 dev_kfree_skb_any(skb);
2063 return -1;
2064 }
2065
2066 return 0;
2067}
2068
2069static int
2070jme_tx_tso(struct sk_buff *skb, __le16 *mss, u8 *flags) 2057jme_tx_tso(struct sk_buff *skb, __le16 *mss, u8 *flags)
2071{ 2058{
2072 *mss = cpu_to_le16(skb_shinfo(skb)->gso_size << TXDESC_MSS_SHIFT); 2059 *mss = cpu_to_le16(skb_shinfo(skb)->gso_size << TXDESC_MSS_SHIFT);
@@ -2225,7 +2212,8 @@ jme_start_xmit(struct sk_buff *skb, struct net_device *netdev)
2225 struct jme_adapter *jme = netdev_priv(netdev); 2212 struct jme_adapter *jme = netdev_priv(netdev);
2226 int idx; 2213 int idx;
2227 2214
2228 if (unlikely(jme_expand_header(jme, skb))) { 2215 if (unlikely(skb_is_gso(skb) && skb_cow_head(skb, 0))) {
2216 dev_kfree_skb_any(skb);
2229 ++(NET_STAT(jme).tx_dropped); 2217 ++(NET_STAT(jme).tx_dropped);
2230 return NETDEV_TX_OK; 2218 return NETDEV_TX_OK;
2231 } 2219 }