diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-04-14 18:59:40 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-14 19:11:33 -0400 |
commit | e743d31312d00932391b123dfac3324d2b9e8c81 (patch) | |
tree | e5ac3aacbfdde1fe8eb44c4e010085915da5ea05 /drivers/net/chelsio | |
parent | b4bf665c5761837f693e87ab27870a5868185ccc (diff) |
drivers: net: use skb_headlen()
replaces (skb->len - skb->data_len) occurrences by skb_headlen(skb)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/chelsio')
-rw-r--r-- | drivers/net/chelsio/sge.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c index a8ffc1e11c5f..f01cfdb995de 100644 --- a/drivers/net/chelsio/sge.c +++ b/drivers/net/chelsio/sge.c | |||
@@ -1123,7 +1123,7 @@ static inline unsigned int compute_large_page_tx_descs(struct sk_buff *skb) | |||
1123 | 1123 | ||
1124 | if (PAGE_SIZE > SGE_TX_DESC_MAX_PLEN) { | 1124 | if (PAGE_SIZE > SGE_TX_DESC_MAX_PLEN) { |
1125 | unsigned int nfrags = skb_shinfo(skb)->nr_frags; | 1125 | unsigned int nfrags = skb_shinfo(skb)->nr_frags; |
1126 | unsigned int i, len = skb->len - skb->data_len; | 1126 | unsigned int i, len = skb_headlen(skb); |
1127 | while (len > SGE_TX_DESC_MAX_PLEN) { | 1127 | while (len > SGE_TX_DESC_MAX_PLEN) { |
1128 | count++; | 1128 | count++; |
1129 | len -= SGE_TX_DESC_MAX_PLEN; | 1129 | len -= SGE_TX_DESC_MAX_PLEN; |
@@ -1219,10 +1219,10 @@ static inline void write_tx_descs(struct adapter *adapter, struct sk_buff *skb, | |||
1219 | ce = &q->centries[pidx]; | 1219 | ce = &q->centries[pidx]; |
1220 | 1220 | ||
1221 | mapping = pci_map_single(adapter->pdev, skb->data, | 1221 | mapping = pci_map_single(adapter->pdev, skb->data, |
1222 | skb->len - skb->data_len, PCI_DMA_TODEVICE); | 1222 | skb_headlen(skb), PCI_DMA_TODEVICE); |
1223 | 1223 | ||
1224 | desc_mapping = mapping; | 1224 | desc_mapping = mapping; |
1225 | desc_len = skb->len - skb->data_len; | 1225 | desc_len = skb_headlen(skb); |
1226 | 1226 | ||
1227 | flags = F_CMD_DATAVALID | F_CMD_SOP | | 1227 | flags = F_CMD_DATAVALID | F_CMD_SOP | |
1228 | V_CMD_EOP(nfrags == 0 && desc_len <= SGE_TX_DESC_MAX_PLEN) | | 1228 | V_CMD_EOP(nfrags == 0 && desc_len <= SGE_TX_DESC_MAX_PLEN) | |
@@ -1258,7 +1258,7 @@ static inline void write_tx_descs(struct adapter *adapter, struct sk_buff *skb, | |||
1258 | 1258 | ||
1259 | ce->skb = NULL; | 1259 | ce->skb = NULL; |
1260 | dma_unmap_addr_set(ce, dma_addr, mapping); | 1260 | dma_unmap_addr_set(ce, dma_addr, mapping); |
1261 | dma_unmap_len_set(ce, dma_len, skb->len - skb->data_len); | 1261 | dma_unmap_len_set(ce, dma_len, skb_headlen(skb)); |
1262 | 1262 | ||
1263 | for (i = 0; nfrags--; i++) { | 1263 | for (i = 0; nfrags--; i++) { |
1264 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; | 1264 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; |